initial commit - cross reference with 5th port - obviously has compile errors
This commit is contained in:
@@ -0,0 +1,223 @@
|
||||
/obj/item/weapon/melee/energy
|
||||
var/active = 0
|
||||
var/force_on = 30 //force when active
|
||||
var/throwforce_on = 20
|
||||
var/icon_state_on = "axe1"
|
||||
var/list/attack_verb_on = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
w_class = 2
|
||||
var/w_class_on = 4
|
||||
heat = 3500
|
||||
|
||||
/obj/item/weapon/melee/energy/suicide_act(mob/user)
|
||||
user.visible_message(pick("<span class='suicide'>[user] is slitting \his stomach open with [src]! It looks like \he's trying to commit seppuku.</span>", \
|
||||
"<span class='suicide'>[user] is falling on [src]! It looks like \he's trying to commit suicide.</span>"))
|
||||
return (BRUTELOSS|FIRELOSS)
|
||||
|
||||
/obj/item/weapon/melee/energy/add_blood(list/blood_dna)
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/melee/energy/is_sharp()
|
||||
return active * sharpness
|
||||
|
||||
/obj/item/weapon/melee/energy/axe
|
||||
name = "energy axe"
|
||||
desc = "An energised battle axe."
|
||||
icon_state = "axe0"
|
||||
force = 40
|
||||
force_on = 150
|
||||
throwforce = 25
|
||||
throwforce_on = 30
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
w_class = 3
|
||||
w_class_on = 5
|
||||
flags = CONDUCT
|
||||
armour_penetration = 100
|
||||
origin_tech = "combat=4;magnets=3"
|
||||
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut")
|
||||
attack_verb_on = list()
|
||||
|
||||
/obj/item/weapon/melee/energy/axe/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] swings the [src.name] towards \his head! It looks like \he's trying to commit suicide.</span>")
|
||||
return (BRUTELOSS|FIRELOSS)
|
||||
|
||||
/obj/item/weapon/melee/energy/sword
|
||||
name = "energy sword"
|
||||
desc = "May the force be within you."
|
||||
icon_state = "sword0"
|
||||
force = 3
|
||||
throwforce = 5
|
||||
hitsound = "swing_hit" //it starts deactivated
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
sharpness = IS_SHARP
|
||||
embed_chance = 75
|
||||
embedded_impact_pain_multiplier = 10
|
||||
armour_penetration = 35
|
||||
origin_tech = "combat=3;magnets=4;syndicate=4"
|
||||
block_chance = 50
|
||||
var/hacked = 0
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/New()
|
||||
if(item_color == null)
|
||||
item_color = pick("red", "blue", "green", "purple")
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance)
|
||||
if(active)
|
||||
return ..()
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/melee/energy/attack_self(mob/living/carbon/user)
|
||||
if(user.disabilities & CLUMSY && prob(50))
|
||||
user << "<span class='warning'>You accidentally cut yourself with [src], like a doofus!</span>"
|
||||
user.take_organ_damage(5,5)
|
||||
active = !active
|
||||
if (active)
|
||||
force = force_on
|
||||
throwforce = throwforce_on
|
||||
hitsound = 'sound/weapons/blade1.ogg'
|
||||
throw_speed = 4
|
||||
if(attack_verb_on.len)
|
||||
attack_verb = attack_verb_on
|
||||
if(!item_color)
|
||||
icon_state = icon_state_on
|
||||
else
|
||||
icon_state = "sword[item_color]"
|
||||
w_class = w_class_on
|
||||
playsound(user, 'sound/weapons/saberon.ogg', 35, 1) //changed it from 50% volume to 35% because deafness
|
||||
user << "<span class='notice'>[src] is now active.</span>"
|
||||
else
|
||||
force = initial(force)
|
||||
throwforce = initial(throwforce)
|
||||
hitsound = initial(hitsound)
|
||||
throw_speed = initial(throw_speed)
|
||||
if(attack_verb_on.len)
|
||||
attack_verb = list()
|
||||
icon_state = initial(icon_state)
|
||||
w_class = initial(w_class)
|
||||
playsound(user, 'sound/weapons/saberoff.ogg', 35, 1) //changed it from 50% volume to 35% because deafness
|
||||
user << "<span class='notice'>[src] can now be concealed.</span>"
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/item/weapon/melee/energy/is_hot()
|
||||
return active * heat
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/cyborg
|
||||
var/hitcost = 50
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/cyborg/attack(mob/M, var/mob/living/silicon/robot/R)
|
||||
if(R.cell)
|
||||
var/obj/item/weapon/stock_parts/cell/C = R.cell
|
||||
if(active && !(C.use(hitcost)))
|
||||
attack_self(R)
|
||||
R << "<span class='notice'>It's out of charge!</span>"
|
||||
return
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/cyborg/saw //Used by medical Syndicate cyborgs
|
||||
name = "energy saw"
|
||||
desc = "For heavy duty cutting. It has a carbon-fiber blade in addition to a toggleable hard-light edge to dramatically increase sharpness."
|
||||
icon_state = "esaw"
|
||||
force_on = 30
|
||||
force = 18 //About as much as a spear
|
||||
hitsound = 'sound/weapons/circsawhit.ogg'
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "esaw_0"
|
||||
icon_state_on = "esaw_1"
|
||||
hitcost = 75 //Costs more than a standard cyborg esword
|
||||
item_color = null
|
||||
w_class = 3
|
||||
sharpness = IS_SHARP
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/cyborg/saw/New()
|
||||
..()
|
||||
icon_state = "esaw_0"
|
||||
item_color = null
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/cyborg/saw/hit_reaction()
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/saber
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/saber/blue
|
||||
item_color = "blue"
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/saber/purple
|
||||
item_color = "purple"
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/saber/green
|
||||
item_color = "green"
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/saber/red
|
||||
item_color = "red"
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/saber/attackby(obj/item/weapon/W, mob/living/user, params)
|
||||
if(istype(W, /obj/item/weapon/melee/energy/sword/saber))
|
||||
user << "<span class='notice'>You attach the ends of the two \
|
||||
energy swords, making a single double-bladed weapon! \
|
||||
You're cool.</span>"
|
||||
var/obj/item/weapon/melee/energy/sword/saber/other_esword = W
|
||||
var/obj/item/weapon/twohanded/dualsaber/newSaber = new(user.loc)
|
||||
if(hacked || other_esword.hacked)
|
||||
newSaber.hacked = TRUE
|
||||
newSaber.item_color = "rainbow"
|
||||
user.unEquip(W)
|
||||
user.unEquip(src)
|
||||
qdel(W)
|
||||
qdel(src)
|
||||
user.put_in_hands(newSaber)
|
||||
else if(istype(W, /obj/item/device/multitool))
|
||||
if(hacked == 0)
|
||||
hacked = 1
|
||||
item_color = "rainbow"
|
||||
user << "<span class='warning'>RNBW_ENGAGE</span>"
|
||||
|
||||
if(active)
|
||||
icon_state = "swordrainbow"
|
||||
// Updating overlays, copied from welder code.
|
||||
// I tried calling attack_self twice, which looked cool, except it somehow didn't update the overlays!!
|
||||
if(user.r_hand == src)
|
||||
user.update_inv_r_hand(0)
|
||||
else if(user.l_hand == src)
|
||||
user.update_inv_l_hand(0)
|
||||
else
|
||||
user << "<span class='warning'>It's already fabulous!</span>"
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/pirate
|
||||
name = "energy cutlass"
|
||||
desc = "Arrrr matey."
|
||||
icon_state = "cutlass0"
|
||||
icon_state_on = "cutlass1"
|
||||
|
||||
/obj/item/weapon/melee/energy/sword/pirate/New()
|
||||
return
|
||||
|
||||
/obj/item/weapon/melee/energy/blade
|
||||
name = "energy blade"
|
||||
desc = "A concentrated beam of energy in the shape of a blade. Very stylish... and lethal."
|
||||
icon_state = "blade"
|
||||
force = 30 //Normal attacks deal esword damage
|
||||
hitsound = 'sound/weapons/blade1.ogg'
|
||||
active = 1
|
||||
throwforce = 1//Throwing or dropping the item deletes it.
|
||||
throw_speed = 3
|
||||
throw_range = 1
|
||||
w_class = 4//So you can't hide it in your pocket or some such.
|
||||
var/datum/effect_system/spark_spread/spark_system
|
||||
|
||||
//Most of the other special functions are handled in their own files. aka special snowflake code so kewl
|
||||
/obj/item/weapon/melee/energy/blade/New()
|
||||
spark_system = new /datum/effect_system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
|
||||
/obj/item/weapon/melee/energy/blade/dropped()
|
||||
..()
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/melee/energy/blade/attack_self(mob/user)
|
||||
return
|
||||
@@ -0,0 +1,220 @@
|
||||
/obj/item/weapon/melee
|
||||
needs_permit = 1
|
||||
|
||||
/obj/item/weapon/melee/chainofcommand
|
||||
name = "chain of command"
|
||||
desc = "A tool used by great men to placate the frothing masses."
|
||||
icon_state = "chain"
|
||||
item_state = "chain"
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
force = 10
|
||||
throwforce = 7
|
||||
w_class = 3
|
||||
origin_tech = "combat=5"
|
||||
attack_verb = list("flogged", "whipped", "lashed", "disciplined")
|
||||
hitsound = 'sound/weapons/slash.ogg' //pls replace
|
||||
materials = list(MAT_METAL = 1000)
|
||||
|
||||
/obj/item/weapon/melee/chainofcommand/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is strangling \himself with the [src.name]! It looks like \he's trying to commit suicide.</span>")
|
||||
return (OXYLOSS)
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/melee/classic_baton
|
||||
name = "police baton"
|
||||
desc = "A wooden truncheon for beating criminal scum."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "baton"
|
||||
item_state = "classic_baton"
|
||||
slot_flags = SLOT_BELT
|
||||
force = 12 //9 hit crit
|
||||
w_class = 3
|
||||
var/cooldown = 0
|
||||
var/on = 1
|
||||
|
||||
/obj/item/weapon/melee/classic_baton/attack(mob/target, mob/living/user)
|
||||
if(!on)
|
||||
return ..()
|
||||
|
||||
add_fingerprint(user)
|
||||
if((CLUMSY in user.disabilities) && prob(50))
|
||||
user << "<span class ='danger'>You club yourself over the head.</span>"
|
||||
user.Weaken(3 * force)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.apply_damage(2*force, BRUTE, "head")
|
||||
else
|
||||
user.take_organ_damage(2*force)
|
||||
return
|
||||
if(isrobot(target))
|
||||
..()
|
||||
return
|
||||
if(!isliving(target))
|
||||
return
|
||||
if (user.a_intent == "harm")
|
||||
if(!..())
|
||||
return
|
||||
if(!isrobot(target))
|
||||
return
|
||||
else
|
||||
if(cooldown <= world.time)
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
if (H.check_shields(0, "[user]'s [name]", src, MELEE_ATTACK))
|
||||
return
|
||||
playsound(get_turf(src), 'sound/effects/woodhit.ogg', 75, 1, -1)
|
||||
target.Weaken(3)
|
||||
add_logs(user, target, "stunned", src)
|
||||
src.add_fingerprint(user)
|
||||
target.visible_message("<span class ='danger'>[user] has knocked down [target] with \the [src]!</span>", \
|
||||
"<span class ='userdanger'>[user] has knocked down [target] with \the [src]!</span>")
|
||||
if(!iscarbon(user))
|
||||
target.LAssailant = null
|
||||
else
|
||||
target.LAssailant = user
|
||||
cooldown = world.time + 40
|
||||
|
||||
/obj/item/weapon/melee/classic_baton/telescopic
|
||||
name = "telescopic baton"
|
||||
desc = "A compact yet robust personal defense weapon. Can be concealed when folded."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "telebaton_0"
|
||||
item_state = null
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 2
|
||||
needs_permit = 0
|
||||
force = 0
|
||||
on = 0
|
||||
|
||||
/obj/item/weapon/melee/classic_baton/telescopic/suicide_act(mob/user)
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/obj/item/organ/brain/B = H.getorgan(/obj/item/organ/brain)
|
||||
|
||||
user.visible_message("<span class='suicide'>[user] stuffs the [src] up their nose and presses the 'extend' button! It looks like they're trying to clear their mind.</span>")
|
||||
if(!on)
|
||||
src.attack_self(user)
|
||||
else
|
||||
playsound(loc, 'sound/weapons/batonextend.ogg', 50, 1)
|
||||
add_fingerprint(user)
|
||||
sleep(3)
|
||||
if (H && !qdeleted(H))
|
||||
if (B && !qdeleted(B))
|
||||
H.internal_organs -= B
|
||||
qdel(B)
|
||||
gibs(H.loc, H.viruses, H.dna)
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/melee/classic_baton/telescopic/attack_self(mob/user)
|
||||
on = !on
|
||||
if(on)
|
||||
user << "<span class ='warning'>You extend the baton.</span>"
|
||||
icon_state = "telebaton_1"
|
||||
item_state = "nullrod"
|
||||
w_class = 4 //doesnt fit in backpack when its on for balance
|
||||
force = 10 //stunbaton damage
|
||||
attack_verb = list("smacked", "struck", "cracked", "beaten")
|
||||
else
|
||||
user << "<span class ='notice'>You collapse the baton.</span>"
|
||||
icon_state = "telebaton_0"
|
||||
item_state = null //no sprite for concealment even when in hand
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 2
|
||||
force = 0 //not so robust now
|
||||
attack_verb = list("hit", "poked")
|
||||
|
||||
playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, 1)
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword
|
||||
name = "supermatter sword"
|
||||
desc = "In a station full of bad ideas, this might just be the worst."
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "supermatter_sword"
|
||||
item_state = "supermatter_sword"
|
||||
slot_flags = null
|
||||
w_class = 4
|
||||
force = 0.001
|
||||
armour_penetration = 1000
|
||||
var/obj/machinery/power/supermatter_shard/shard
|
||||
var/balanced = 1
|
||||
origin_tech = "combat=7;materials=6"
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/New()
|
||||
..()
|
||||
shard = new /obj/machinery/power/supermatter_shard(src)
|
||||
START_PROCESSING(SSobj, src)
|
||||
visible_message("<span class='warning'>\The [src] appears, balanced ever so perfectly on its hilt. This isn't ominous at all.</span>")
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/process()
|
||||
if(balanced || throwing || ismob(src.loc) || isnull(src.loc))
|
||||
return
|
||||
if(!isturf(src.loc))
|
||||
var/atom/target = src.loc
|
||||
loc = target.loc
|
||||
consume_everything(target)
|
||||
else
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T,/turf/open/space))
|
||||
consume_turf(T)
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/afterattack(target, mob/user, proximity_flag)
|
||||
if(user && target == user)
|
||||
user.drop_item()
|
||||
if(proximity_flag)
|
||||
consume_everything(target)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/throw_impact(target)
|
||||
..()
|
||||
if(ismob(target))
|
||||
var/mob/M
|
||||
if(src.loc == M)
|
||||
M.drop_item()
|
||||
consume_everything(target)
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/pickup(user)
|
||||
..()
|
||||
balanced = 0
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/ex_act(severity, target)
|
||||
visible_message("<span class='danger'>\The blast wave smacks into \the [src] and rapidly flashes to ash.</span>",\
|
||||
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
|
||||
consume_everything()
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/acid_act()
|
||||
visible_message("<span class='danger'>\The acid smacks into \the [src] and rapidly flashes to ash.</span>",\
|
||||
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
|
||||
consume_everything()
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/bullet_act(obj/item/projectile/P)
|
||||
visible_message("<span class='danger'>[P] smacks into \the [src] and rapidly flashes to ash.</span>",\
|
||||
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
|
||||
consume_everything()
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] touches the [src]'s blade. It looks like they're tired of waiting for the radiation to kill them!</span>")
|
||||
user.drop_item()
|
||||
shard.Bumped(user)
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/proc/consume_everything(target)
|
||||
if(isnull(target))
|
||||
shard.Consume()
|
||||
else if(!isturf(target))
|
||||
shard.Bumped(target)
|
||||
else
|
||||
consume_turf(target)
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/proc/consume_turf(turf/T)
|
||||
if(istype(T, T.baseturf))
|
||||
return //Can't void the void, baby!
|
||||
playsound(T, 'sound/effects/supermatter.ogg', 50, 1)
|
||||
T.visible_message("<span class='danger'>\The [T] smacks into \the [src] and rapidly flashes to ash.</span>",\
|
||||
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
|
||||
shard.Consume()
|
||||
T.ChangeTurf(T.baseturf)
|
||||
T.CalculateAdjacentTurfs()
|
||||
|
||||
/obj/item/weapon/melee/supermatter_sword/add_blood(list/blood_dna)
|
||||
return 0
|
||||
Reference in New Issue
Block a user