mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-09 16:07:40 +00:00
387 lines
15 KiB
Plaintext
387 lines
15 KiB
Plaintext
/obj/item/melee/transforming/energy
|
|
hitsound_on = 'sound/weapons/blade1.ogg'
|
|
heat = 3500
|
|
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
|
|
total_mass = 0.4 //Survival flashlights typically weigh around 5 ounces.
|
|
|
|
|
|
/obj/item/melee/transforming/energy/Initialize()
|
|
. = ..()
|
|
total_mass_on = (total_mass_on ? total_mass_on : (w_class_on * 0.75))
|
|
if(active)
|
|
set_light(brightness_on)
|
|
START_PROCESSING(SSobj, src)
|
|
|
|
/obj/item/melee/transforming/energy/Destroy()
|
|
STOP_PROCESSING(SSobj, src)
|
|
return ..()
|
|
|
|
/obj/item/melee/transforming/energy/suicide_act(mob/user)
|
|
if(!active)
|
|
transform_weapon(user, TRUE)
|
|
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/melee/transforming/energy/add_blood_DNA(list/blood_dna)
|
|
return FALSE
|
|
|
|
/obj/item/melee/transforming/energy/get_sharpness()
|
|
return active * sharpness
|
|
|
|
/obj/item/melee/transforming/energy/process()
|
|
open_flame()
|
|
|
|
/obj/item/melee/transforming/energy/transform_weapon(mob/living/user, supress_message_text)
|
|
. = ..()
|
|
if(.)
|
|
if(active)
|
|
if(item_color)
|
|
icon_state = "sword[item_color]"
|
|
START_PROCESSING(SSobj, src)
|
|
set_light(brightness_on)
|
|
else
|
|
STOP_PROCESSING(SSobj, src)
|
|
set_light(0)
|
|
|
|
/obj/item/melee/transforming/energy/get_temperature()
|
|
return active * heat
|
|
|
|
/obj/item/melee/transforming/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)
|
|
in_mouth = ", barely missing [C.p_their()] nose"
|
|
. = "<span class='warning'>[user] swings [user.p_their()] [name][in_mouth]. [user.p_they(TRUE)] light[user.p_s()] [user.p_their()] [A.name] in the process.</span>"
|
|
playsound(loc, hitsound, get_clamped_volume(), 1, -1)
|
|
add_fingerprint(user)
|
|
|
|
/obj/item/melee/transforming/energy/axe
|
|
name = "energy axe"
|
|
desc = "An energized battle axe."
|
|
icon_state = "axe0"
|
|
lefthand_file = 'icons/mob/inhands/weapons/axes_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/weapons/axes_righthand.dmi'
|
|
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_1 = CONDUCT_1
|
|
armour_penetration = 100
|
|
attack_verb_off = list("attacked", "chopped", "cleaved", "torn", "cut")
|
|
attack_verb_on = list()
|
|
light_color = "#40ceff"
|
|
total_mass = null
|
|
|
|
/obj/item/melee/transforming/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/melee/transforming/energy/sword
|
|
name = "energy sword"
|
|
desc = "May the force be within you."
|
|
icon_state = "sword0"
|
|
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
|
|
force = 3
|
|
throwforce = 5
|
|
hitsound = "swing_hit" //it starts deactivated
|
|
attack_verb_off = list("tapped", "poked")
|
|
throw_speed = 3
|
|
throw_range = 5
|
|
sharpness = IS_SHARP
|
|
embedding = list("embed_chance" = 75, "embedded_impact_pain_multiplier" = 10)
|
|
armour_penetration = 35
|
|
block_chance = 50
|
|
|
|
/obj/item/melee/transforming/energy/sword/transform_weapon(mob/living/user, supress_message_text)
|
|
. = ..()
|
|
if(. && active && item_color)
|
|
icon_state = "sword[item_color]"
|
|
|
|
/obj/item/melee/transforming/energy/sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
|
if(active)
|
|
return ..()
|
|
return 0
|
|
|
|
/obj/item/melee/transforming/energy/sword/cyborg
|
|
item_color = "red"
|
|
var/hitcost = 50
|
|
|
|
/obj/item/melee/transforming/energy/sword/cyborg/attack(mob/M, var/mob/living/silicon/robot/R)
|
|
if(R.cell)
|
|
var/obj/item/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/melee/transforming/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."
|
|
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"
|
|
item_color = null //stops icon from breaking when turned on.
|
|
hitcost = 75 //Costs more than a standard cyborg esword
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
sharpness = IS_SHARP
|
|
light_color = "#40ceff"
|
|
tool_behaviour = TOOL_SAW
|
|
toolspeed = 0.7
|
|
|
|
/obj/item/melee/transforming/energy/sword/cyborg/saw/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
|
return 0
|
|
|
|
/obj/item/melee/transforming/energy/sword/saber
|
|
var/list/possible_colors = list("red" = LIGHT_COLOR_RED, "blue" = LIGHT_COLOR_LIGHT_CYAN, "green" = LIGHT_COLOR_GREEN, "purple" = LIGHT_COLOR_LAVENDER)
|
|
var/hacked = FALSE
|
|
|
|
/obj/item/melee/transforming/energy/sword/saber/Initialize(mapload)
|
|
. = ..()
|
|
if(LAZYLEN(possible_colors))
|
|
var/set_color = pick(possible_colors)
|
|
item_color = set_color
|
|
light_color = possible_colors[set_color]
|
|
|
|
/obj/item/melee/transforming/energy/sword/saber/process()
|
|
. = ..()
|
|
if(hacked)
|
|
var/set_color = pick(possible_colors)
|
|
light_color = possible_colors[set_color]
|
|
update_light()
|
|
|
|
/obj/item/melee/transforming/energy/sword/saber/red
|
|
possible_colors = list("red" = LIGHT_COLOR_RED)
|
|
|
|
/obj/item/melee/transforming/energy/sword/saber/blue
|
|
possible_colors = list("blue" = LIGHT_COLOR_LIGHT_CYAN)
|
|
|
|
/obj/item/melee/transforming/energy/sword/saber/green
|
|
possible_colors = list("green" = LIGHT_COLOR_GREEN)
|
|
|
|
/obj/item/melee/transforming/energy/sword/saber/purple
|
|
possible_colors = list("purple" = LIGHT_COLOR_LAVENDER)
|
|
|
|
/obj/item/melee/transforming/energy/sword/saber/attackby(obj/item/W, mob/living/user, params)
|
|
if(istype(W, /obj/item/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/melee/transforming/energy/sword/pirate
|
|
name = "energy cutlass"
|
|
desc = "Arrrr matey."
|
|
icon_state = "cutlass0"
|
|
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
|
|
icon_state_on = "cutlass1"
|
|
light_color = "#ff0000"
|
|
|
|
/obj/item/melee/transforming/energy/blade
|
|
name = "energy blade"
|
|
desc = "A concentrated beam of energy in the shape of a blade. Very stylish... and lethal."
|
|
icon_state = "blade"
|
|
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
|
|
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/melee/transforming/energy/blade/Initialize()
|
|
. = ..()
|
|
spark_system = new /datum/effect_system/spark_spread()
|
|
spark_system.set_up(5, 0, src)
|
|
spark_system.attach(src)
|
|
|
|
/obj/item/melee/transforming/energy/blade/transform_weapon(mob/living/user, supress_message_text)
|
|
return
|
|
|
|
/obj/item/melee/transforming/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"
|
|
|
|
/*/////////////////////////////////////////////////////////////////////////
|
|
///////////// The TRUE Energy Sword ///////////////////////////
|
|
*//////////////////////////////////////////////////////////////////////////
|
|
|
|
/obj/item/melee/transforming/energy/sword/cx
|
|
name = "non-eutactic blade"
|
|
desc = "The Non-Eutactic Blade utilizes a hardlight blade that is dynamically 'forged' on demand to create a deadly sharp edge that is unbreakable."
|
|
icon_state = "cxsword_hilt"
|
|
item_state = "cxsword"
|
|
force = 3
|
|
force_on = 21
|
|
throwforce = 5
|
|
throwforce_on = 20
|
|
hitsound = "swing_hit" //it starts deactivated
|
|
hitsound_on = 'sound/weapons/nebhit.ogg'
|
|
attack_verb_off = list("tapped", "poked")
|
|
throw_speed = 3
|
|
throw_range = 5
|
|
sharpness = IS_SHARP
|
|
embedding = list("embedded_pain_multiplier" = 6, "embed_chance" = 20, "embedded_fall_chance" = 60)
|
|
armour_penetration = 10
|
|
block_chance = 35
|
|
light_color = "#37FFF7"
|
|
actions_types = list()
|
|
|
|
/obj/item/melee/transforming/energy/sword/cx/pre_altattackby(atom/A, mob/living/user, params) //checks if it can do right click memes
|
|
altafterattack(A, user, TRUE, params)
|
|
return TRUE
|
|
|
|
/obj/item/melee/transforming/energy/sword/cx/altafterattack(atom/target, mob/living/carbon/user, proximity_flag, click_parameters) //does right click memes
|
|
if(istype(user))
|
|
user.visible_message("<span class='notice'>[user] points the tip of [src] at [target].</span>", "<span class='notice'>You point the tip of [src] at [target].</span>")
|
|
return TRUE
|
|
|
|
/obj/item/melee/transforming/energy/sword/cx/transform_weapon(mob/living/user, supress_message_text)
|
|
active = !active //I'd use a ..() here but it'd inherit from the regular esword's proc instead, so SPAGHETTI CODE
|
|
if(active) //also I'd need to rip out the iconstate changing bits
|
|
force = force_on
|
|
throwforce = throwforce_on
|
|
hitsound = hitsound_on
|
|
throw_speed = 4
|
|
if(attack_verb_on.len)
|
|
attack_verb = attack_verb_on
|
|
w_class = w_class_on
|
|
START_PROCESSING(SSobj, src)
|
|
set_light(brightness_on)
|
|
update_icon()
|
|
else
|
|
force = initial(force)
|
|
throwforce = initial(throwforce)
|
|
hitsound = initial(hitsound)
|
|
throw_speed = initial(throw_speed)
|
|
if(attack_verb_off.len)
|
|
attack_verb = attack_verb_off
|
|
w_class = initial(w_class)
|
|
STOP_PROCESSING(SSobj, src)
|
|
set_light(0)
|
|
update_icon()
|
|
transform_messages(user, supress_message_text)
|
|
add_fingerprint(user)
|
|
return TRUE
|
|
|
|
/obj/item/melee/transforming/energy/sword/cx/transform_messages(mob/living/user, supress_message_text)
|
|
playsound(user, active ? 'sound/weapons/nebon.ogg' : 'sound/weapons/neboff.ogg', 65, 1)
|
|
if(!supress_message_text)
|
|
to_chat(user, "<span class='notice'>[src] [active ? "is now active":"can now be concealed"].</span>")
|
|
|
|
/obj/item/melee/transforming/energy/sword/cx/update_icon()
|
|
var/mutable_appearance/blade_overlay = mutable_appearance(icon, "cxsword_blade")
|
|
var/mutable_appearance/gem_overlay = mutable_appearance(icon, "cxsword_gem")
|
|
|
|
if(light_color)
|
|
blade_overlay.color = light_color
|
|
gem_overlay.color = light_color
|
|
|
|
cut_overlays() //So that it doesn't keep stacking overlays non-stop on top of each other
|
|
|
|
add_overlay(gem_overlay)
|
|
|
|
if(active)
|
|
add_overlay(blade_overlay)
|
|
if(ismob(loc))
|
|
var/mob/M = loc
|
|
M.update_inv_hands()
|
|
|
|
/obj/item/melee/transforming/energy/sword/cx/AltClick(mob/living/user)
|
|
. = ..()
|
|
if(!in_range(src, user)) //Basic checks to prevent abuse
|
|
return
|
|
if(user.incapacitated() || !istype(user))
|
|
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
|
return TRUE
|
|
|
|
if(alert("Are you sure you want to recolor your blade?", "Confirm Repaint", "Yes", "No") == "Yes")
|
|
var/energy_color_input = input(usr,"","Choose Energy Color",light_color) as color|null
|
|
if(energy_color_input)
|
|
light_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1)
|
|
update_icon()
|
|
update_light()
|
|
return TRUE
|
|
|
|
/obj/item/melee/transforming/energy/sword/cx/examine(mob/user)
|
|
. = ..()
|
|
. += "<span class='notice'>Alt-click to recolor it.</span>"
|
|
|
|
/obj/item/melee/transforming/energy/sword/cx/worn_overlays(isinhands, icon_file)
|
|
. = ..()
|
|
if(active)
|
|
if(isinhands)
|
|
var/mutable_appearance/blade_inhand = mutable_appearance(icon_file, "cxsword_blade")
|
|
blade_inhand.color = light_color
|
|
. += blade_inhand
|
|
|
|
//Broken version. Not a toy, but not as strong.
|
|
/obj/item/melee/transforming/energy/sword/cx/broken
|
|
name = "misaligned non-eutactic blade"
|
|
desc = "The Non-Eutactic Blade utilizes a hardlight blade that is dynamically 'forged' on demand to create a deadly sharp edge that is unbreakable. This one seems to have a damaged handle and misaligned components, causing the blade to be unstable at best"
|
|
force_on = 15 //As strong a survival knife/bone dagger
|
|
|
|
/obj/item/melee/transforming/energy/sword/cx/attackby(obj/item/W, mob/living/user, params)
|
|
if(istype(W, /obj/item/melee/transforming/energy/sword/cx))
|
|
if(HAS_TRAIT(W, TRAIT_NODROP) || HAS_TRAIT(src, TRAIT_NODROP))
|
|
to_chat(user, "<span class='warning'>\the [HAS_TRAIT(src, TRAIT_NODROP) ? src : W] is stuck to your hand, you can't attach it to \the [HAS_TRAIT(src, TRAIT_NODROP) ? W : src]!</span>")
|
|
return
|
|
else
|
|
to_chat(user, "<span class='notice'>You combine the two light swords, making a single supermassive blade! You're cool.</span>")
|
|
new /obj/item/twohanded/dualsaber/hypereutactic(user.drop_location())
|
|
qdel(W)
|
|
qdel(src)
|
|
else
|
|
return ..()
|
|
|
|
//////// Tatortot NEB /////////////// (same stats as regular esword)
|
|
/obj/item/melee/transforming/energy/sword/cx/traitor
|
|
name = "\improper Dragon's Tooth Sword"
|
|
desc = "The Dragon's Tooth sword is a blackmarket modification of a Non-Eutactic Blade, \
|
|
which utilizes a hardlight blade that is dynamically 'forged' on demand to create a deadly sharp edge that is unbreakable. \
|
|
It appears to have a wooden grip and a shaved down guard."
|
|
icon_state = "cxsword_hilt_traitor"
|
|
force_on = 30
|
|
armour_penetration = 35
|
|
embedding = list("embedded_pain_multiplier" = 10, "embed_chance" = 75, "embedded_fall_chance" = 0, "embedded_impact_pain_multiplier" = 10)
|
|
block_chance = 50
|
|
hitsound_on = 'sound/weapons/blade1.ogg'
|
|
light_color = "#37F0FF"
|
|
|
|
/obj/item/melee/transforming/energy/sword/cx/traitor/transform_messages(mob/living/user, supress_message_text)
|
|
playsound(user, active ? 'sound/weapons/saberon.ogg' : 'sound/weapons/saberoff.ogg', 35, 1)
|
|
if(!supress_message_text)
|
|
to_chat(user, "<span class='notice'>[src] [active ? "is now active":"can now be concealed"].</span>")
|