Files
GS13NG/code/game/objects/items/weapons/melee/energy.dm
CitadelStationBot a317d23a51 [MIRROR] Manifest Spirit is better for summoning cannon fodder but slightly worse for instantly summoning Nar-Sie (#916)
* Manifest Spirit is better for summoning cannon fodder but slightly worse for instantly summoning Nar-Sie

* fixes .rej
2017-05-18 09:37:30 -05:00

260 lines
8.3 KiB
Plaintext

/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")
var/list/possible_colors
w_class = WEIGHT_CLASS_SMALL
sharpness = IS_SHARP
var/w_class_on = WEIGHT_CLASS_BULKY
heat = 3500
obj_integrity = 200
max_integrity = 200
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 30)
resistance_flags = FIRE_PROOF
var/brightness_on = 3
/obj/item/weapon/melee/energy/Initialize()
. = ..()
if(LAZYLEN(possible_colors))
item_color = pick(possible_colors)
switch(item_color)//Only run this check if the color was picked randomly, so that colors can be manually set for non-random colored energy weapons.
if("red")
light_color = LIGHT_COLOR_RED
if("green")
light_color = LIGHT_COLOR_GREEN
if("blue")
light_color = LIGHT_COLOR_LIGHT_CYAN
if("purple")
light_color = LIGHT_COLOR_LAVENDER
if(active)
set_light(brightness_on)
/obj/item/weapon/melee/energy/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is [pick("slitting [user.p_their()] stomach open with", "falling on")] [src]! It looks like [user.p_theyre()] trying to commit seppuku!</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 energized 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 = WEIGHT_CLASS_NORMAL
w_class_on = WEIGHT_CLASS_HUGE
flags = CONDUCT
armour_penetration = 100
origin_tech = "combat=4;magnets=3"
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut")
attack_verb_on = list()
light_color = "#40ceff"
/obj/item/weapon/melee/energy/axe/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] swings [src] towards [user.p_their()] head! It looks like [user.p_theyre()] 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
possible_colors = list("red", "blue", "green", "purple")
var/hacked = 0
/obj/item/weapon/melee/energy/sword/Destroy()
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/item/weapon/melee/energy/sword/process()
if(active)
if(hacked)
light_color = pick(LIGHT_COLOR_RED, LIGHT_COLOR_GREEN, LIGHT_COLOR_LIGHT_CYAN, LIGHT_COLOR_LAVENDER)
open_flame()
else
STOP_PROCESSING(SSobj, src)
/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))
to_chat(user, "<span class='warning'>You accidentally cut yourself with [src], like a doofus!</span>")
user.take_bodypart_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
to_chat(user, "<span class='notice'>[src] is now active.</span>")
START_PROCESSING(SSobj, src)
set_light(brightness_on)
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
to_chat(user, "<span class='notice'>[src] can now be concealed.</span>")
STOP_PROCESSING(SSobj, src)
set_light(0)
add_fingerprint(user)
/obj/item/weapon/melee/energy/is_hot()
return active * heat
/obj/item/weapon/melee/energy/ignition_effect(atom/A, mob/user)
if(!active)
return ""
var/in_mouth = ""
if(iscarbon(user))
var/mob/living/carbon/C = user
if(C.wear_mask == src)
in_mouth = ", barely missing their nose"
. = "<span class='warning'>[user] swings their \
[src][in_mouth]. They light [A] in the process.</span>"
playsound(loc, hitsound, get_clamped_volume(), 1, -1)
add_fingerprint(user)
/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)
to_chat(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 = WEIGHT_CLASS_NORMAL
sharpness = IS_SHARP
light_color = "#40ceff"
possible_colors = null
/obj/item/weapon/melee/energy/sword/cyborg/saw/Initialize()
. = ..()
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
possible_colors = list("blue")
/obj/item/weapon/melee/energy/sword/saber/purple
possible_colors = list("purple")
/obj/item/weapon/melee/energy/sword/saber/green
possible_colors = list("green")
/obj/item/weapon/melee/energy/sword/saber/red
possible_colors = list("red")
/obj/item/weapon/melee/energy/sword/saber/attackby(obj/item/weapon/W, mob/living/user, params)
if(istype(W, /obj/item/device/multitool))
if(!hacked)
hacked = TRUE
item_color = "rainbow"
to_chat(user, "<span class='warning'>RNBW_ENGAGE</span>")
if(active)
icon_state = "swordrainbow"
user.update_inv_hands()
else
to_chat(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"
light_color = "#ff0000"
/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 = WEIGHT_CLASS_BULKY//So you can't hide it in your pocket or some such.
var/datum/effect_system/spark_spread/spark_system
sharpness = IS_SHARP
//Most of the other special functions are handled in their own files. aka special snowflake code so kewl
/obj/item/weapon/melee/energy/blade/Initialize()
. = ..()
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/attack_self(mob/user)
return
/obj/item/weapon/melee/energy/blade/hardlight
name = "hardlight blade"
desc = "An extremely sharp blade made out of hard light. Packs quite a punch."
icon_state = "lightblade"
item_state = "lightblade"