Files
DoomWeapons.sk
Code
1 446
DoomWeapons.sk
# ============================================================
# DoomWeapons.sk
# Doom-inspired weapons mod for Minecraft
# Place in: plugins/Skript/scripts/
# Reload with: /sk reload DoomWeapons
# ============================================================
options:
prefix: &4[&cDOOM&4]&r
chainsaw-damage: 8
pistol-damage: 6
shotgun-damage: 14
chaingun-damage: 5
rocket-damage: 18
plasma-damage: 9
bfg-damage: 40
chainsaw-cooldown: 0.3
pistol-cooldown: 0.8
shotgun-cooldown: 1.2
chaingun-cooldown: 0.15
rocket-cooldown: 1.5
plasma-cooldown: 0.25
bfg-cooldown: 5.0
chainsaw-range: 3
pistol-range: 40
shotgun-range: 20
chaingun-range: 35
rocket-range: 50
plasma-range: 45
bfg-range: 60
bfg-aoe-radius: 10
# ============================================================
# WEAPON ITEM DEFINITIONS (Functions)
# ============================================================
function makechainsaw() :: item:
set {_i} to golden axe named "&2&lCHAINSAW"
set lore of {_i} to "&7Melee | &aRapid Damage", "&8Rip and tear until it is done.", "&6Dmg: &c{@chainsaw-damage}/hit &7| &6Cooldown: &e{@chainsaw-cooldown}s"
return {_i}
function makepistol() :: item:
set {_i} to iron hoe named "&f&lPISTOL"
set lore of {_i} to "&7Ranged | &aSingle Shot", "&8A reliable sidearm.", "&6Dmg: &c{@pistol-damage} &7| &6Cooldown: &e{@pistol-cooldown}s"
return {_i}
function makeshotgun() :: item:
set {_i} to stone shovel named "&e&lSHOTGUN"
set lore of {_i} to "&7Ranged | &aSpread Shot", "&8Sends 5 pellets in a cone.", "&6Dmg: &c{@shotgun-damage} &7| &6Cooldown: &e{@shotgun-cooldown}s"
return {_i}
function makechaingun() :: item:
set {_i} to iron sword named "&6&lCHAINGUN"
set lore of {_i} to "&7Ranged | &aRapid Fire", "&8Endless stream of bullets.", "&6Dmg: &c{@chaingun-damage}/bullet &7| &6Cooldown: &e{@chaingun-cooldown}s"
return {_i}
function makerocket() :: item:
set {_i} to blaze rod named "&c&lROCKET LAUNCHER"
set lore of {_i} to "&7Ranged | &aExplosion", "&8Boom. Just boom.", "&6Dmg: &c{@rocket-damage} &7| &6Cooldown: &e{@rocket-cooldown}s"
return {_i}
function makeplasma() :: item:
set {_i} to blaze powder named "&b&lPLASMA GUN"
set lore of {_i} to "&7Ranged | &aEnergy Bolts", "&8Rapid plasma discharge.", "&6Dmg: &c{@plasma-damage}/bolt &7| &6Cooldown: &e{@plasma-cooldown}s"
return {_i}
function makebfg() :: item:
set {_i} to nether star named "&a&lBFG 9000"
set lore of {_i} to "&7Ranged | &a&lMassive AOE", "&8Big F***ing Gun. Enough said.", "&6Dmg: &c{@bfg-damage} &7| &6Cooldown: &e{@bfg-cooldown}s", "&4&lWARNING: &cDestroys EVERYTHING nearby."
return {_i}
# ============================================================
# WEAPON DETECTION HELPERS
# ============================================================
function ischainsaw(p: player) :: boolean:
if name of tool of {_p} is "&2&lCHAINSAW":
return true
return false
function ispistol(p: player) :: boolean:
if name of tool of {_p} is "&f&lPISTOL":
return true
return false
function isshotgun(p: player) :: boolean:
if name of tool of {_p} is "&e&lSHOTGUN":
return true
return false
function ischaingun(p: player) :: boolean:
if name of tool of {_p} is "&6&lCHAINGUN":
return true
return false
function isrocket(p: player) :: boolean:
if name of tool of {_p} is "&c&lROCKET LAUNCHER":
return true
return false
function isplasma(p: player) :: boolean:
if name of tool of {_p} is "&b&lPLASMA GUN":
return true
return false
function isbfg(p: player) :: boolean:
if name of tool of {_p} is "&a&lBFG 9000":
return true
return false
# ============================================================
# GIVE COMMAND
# ============================================================
command /doomweapon <text>:
aliases: /dw, /doom
permission: doom.weapon.give
permission message: {@prefix} &cYou don't have permission!
trigger:
if arg-1 is "chainsaw":
give player makechainsaw()
send "{@prefix} &2You received the &lCHAINSAW&r&2!" to player
else if arg-1 is "pistol":
give player makepistol()
send "{@prefix} &fYou received the &lPISTOL&r&f!" to player
else if arg-1 is "shotgun":
give player makeshotgun()
send "{@prefix} &eYou received the &lSHOTGUN&r&e!" to player
else if arg-1 is "chaingun":
give player makechaingun()
send "{@prefix} &6You received the &lCHAINGUN&r&6!" to player
else if arg-1 is "rocket" or arg-1 is "rocketlauncher" or arg-1 is "rl":
give player makerocket()
send "{@prefix} &cYou received the &lROCKET LAUNCHER&r&c!" to player
else if arg-1 is "plasma" or arg-1 is "plasmagun":
give player makeplasma()
send "{@prefix} &bYou received the &lPLASMA GUN&r&b!" to player
else if arg-1 is "bfg" or arg-1 is "bfg9000":
give player makebfg()
send "{@prefix} &aYou received the &lBFG 9000&r&a!" to player
else if arg-1 is "all":
give player makechainsaw()
give player makepistol()
give player makeshotgun()
give player makechaingun()
give player makerocket()
give player makeplasma()
give player makebfg()
send "{@prefix} &aYou received &lALL DOOM WEAPONS&r&a!" to player
else:
send "{@prefix} &cUnknown weapon. Use: &echainsaw&c, &epistol&c, &eshotgun&c, &echaingun&c, &erocket&c, &eplasma&c, &ebfg&c, &eall" to player
# ============================================================
# RIGHT-CLICK TO FIRE / ATTACK
# ============================================================
on right click:
# Block interacting with blocks for weapons
if ischainsaw(player) is true:
cancel event
fire_chainsaw(player)
else if ispistol(player) is true:
cancel event
fire_pistol(player)
else if isshotgun(player) is true:
cancel event
fire_shotgun(player)
else if ischaingun(player) is true:
cancel event
fire_chaingun(player)
else if isrocket(player) is true:
cancel event
fire_rocket(player)
else if isplasma(player) is true:
cancel event
fire_plasma(player)
else if isbfg(player) is true:
cancel event
fire_bfg(player)
# Left click also triggers weapons
on left click:
if ischainsaw(player) is true:
cancel event
fire_chainsaw(player)
else if ispistol(player) is true:
cancel event
fire_pistol(player)
else if isshotgun(player) is true:
cancel event
fire_shotgun(player)
else if ischaingun(player) is true:
cancel event
fire_chaingun(player)
else if isrocket(player) is true:
cancel event
fire_rocket(player)
else if isplasma(player) is true: