diff --git a/code/__DEFINES/movespeed_modification.dm b/code/__DEFINES/movespeed_modification.dm index 1883df6e8e..2db40cc988 100644 --- a/code/__DEFINES/movespeed_modification.dm +++ b/code/__DEFINES/movespeed_modification.dm @@ -68,4 +68,6 @@ #define MOVESPEED_ID_SHOVE "SHOVE" -#define MOVESPEED_ID_MKULTRA "MKULTRA" \ No newline at end of file +#define MOVESPEED_ID_MKULTRA "MKULTRA" + +#define MOVESPEED_ID_ELECTROSTAFF "ELECTROSTAFF" diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index 6d52f4640c..859e361250 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -88,6 +88,9 @@ #define STATUS_EFFECT_NO_COMBAT_MODE /datum/status_effect/no_combat_mode //Wont allow combat mode and will disable it #define STATUS_EFFECT_MESMERIZE /datum/status_effect/no_combat_mode/mesmerize //Just reskinned no_combat_mode + +#define STATUS_EFFECT_ELECTROSTAFF /datum/status_effect/electrostaff //slows down victim + ///////////// // NEUTRAL // ///////////// diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 2e46046a7e..335bdfac6e 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -587,6 +587,19 @@ icon_state = "ichorial_stain" alerttooltipstyle = "clockcult" +/datum/status_effect/electrostaff + id = "electrostaff" + alert_type = null + status_type = STATUS_EFFECT_REPLACE + +/datum/status_effect/electrostaff/on_creation(mob/living/new_owner, set_duration) + if(isnum(set_duration)) + duration = set_duration + . = ..() + owner.add_movespeed_modifier(MOVESPEED_ID_ELECTROSTAFF, multiplicative_slowdown = 1, movetypes = GROUND, blacklisted_movetypes = CRAWLING) + +/datum/status_effect/electrostaff/on_remove() + owner.remove_movespeed_modifier(MOVESPEED_ID_ELECTROSTAFF) //GOLEM GANG diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index f777c893f8..29116b5a7c 100755 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -17,7 +17,8 @@ /obj/item/ammo_box/magazine/recharge, /obj/item/modular_computer, /obj/item/gun/ballistic/automatic/magrifle_e, - /obj/item/gun/ballistic/automatic/pistol/mag_e)) + /obj/item/gun/ballistic/automatic/pistol/mag_e, + /obj/item/twohanded/required/electrostaff)) /obj/machinery/recharger/RefreshParts() for(var/obj/item/stock_parts/capacitor/C in component_parts) diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm index 28a6fd66ee..44fe9e3a0e 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -1017,3 +1017,240 @@ C.change_view(CONFIG_GET(string/default_view)) user.client.pixel_x = 0 user.client.pixel_y = 0 + +/obj/item/twohanded/required/electrostaff + icon = 'icons/obj/estaff.dmi' + icon_state = "electrostaff_3" + item_state = "electrostaff_3" + lefthand_file = 'icons/mob/inhands/weapons/estaff_lefthand.dmi' + righthand_file = 'icons/mob/inhands/weapons/estaff_righthand.dmi' + name = "riot suppression electrostaff" + desc = "A large quarterstaff, with massive silver electrodes mounted at the end." + force = 10 + damtype = BRUTE + w_class = WEIGHT_CLASS_GIGANTIC + slot_flags = ITEM_SLOT_BACK + sharpness = FALSE + force_unwielded = 0 + force_wielded = 10 + throwforce = 1 + throw_speed = 1 + block_chance = 50 + materials = list(MAT_METAL=1000) + hitsound = 'sound/weapons/staff.ogg' + attack_verb = list("suppresed", "struck", "beaten", "thwacked", "pulped", "shocked") + total_mass = 5 //yeah this is a heavy thing, beating people with it while it's off is not going to do you any favors. + var/obj/item/stock_parts/cell/cell = /obj/item/stock_parts/cell/high + var/lethal_cost = 400 //10000/333*15 = 450. decent enough?? kinda? + var/lethal_damage = 15 + var/lethal_stam_cost = 3.5 + var/stun_cost = 333 //10000/500*25 = 500. stunbatons are at time of writing 10000/1000*49 = 490. This doesn't stun as fast but has block. Also, this does.. + var/stun_status_effect = STATUS_EFFECT_ELECTROSTAFF //a small slowdown effect + var/stun_stamdmg = 25 + var/stun_status_duration = 25 + var/stun_stam_cost = 3.5 + +/obj/item/twohanded/required/electrostaff/Initialize(mapload) + . = ..() + if(ispath(cell)) + cell = new cell + +/obj/item/twohanded/required/electrostaff/get_cell() + . = cell + if(iscyborg(loc)) + var/mob/living/silicon/robot/R = loc + . = R.get_cell() + +/obj/item/twohanded/required/electrostaff/proc/min_hitcost() + return min(stun_cost, lethal_cost) + +/obj/item/twohanded/required/electrostaff/proc/turn_on(mob/user, silent = FALSE) + if(on) + return + if(!cell) + if(user) + to_chat(user, "[src] has no cell.") + return + if(cell.charge < min_hitcost()) + if(user) + to_chat(user, "[src] is out of charge.") + return + on = TRUE + START_PROCESSING(SSobj, src) + if(user) + to_chat(user, "You turn [src] on.") + update_icon() + if(!silent) + playsound(src, "sparks", 75, 1, -1) + +/obj/item/twohanded/required/electrostaff/proc/turn_off(mob/user, silent = FALSE) + if(!on) + return + if(user) + to_chat(user, "You turn [src] off.") + on = FALSE + STOP_PROCESSING(SSobj, src) + update_icon() + if(!silent) + playsound(src, "sparks", 75, 1, -1) + +/obj/item/twohanded/required/electrostaff/proc/toggle(mob/user, silent = FALSE) + if(on) + turn_off(user, silent) + else + turn_on(user, silent) + +/obj/item/twohanded/required/electrostaff/attack_self(mob/user) + . = ..() + if(.) + return + toggle(user) + add_fingerprint(user) + +/obj/item/twohanded/required/electrostaff/update_icon() + . = ..() + var/final = on? "electrostaff_1" : "electrostaff_3" + icon_state = final + item_state = final + set_light(7, on? 1 : 0, LIGHT_COLOR_CYAN) + +/obj/item/twohanded/required/electrostaff/examine(mob/living/user) + . = ..() + if(cell) + . += "The cell charge is [round(cell.percent())]%." + else + . += "There is no cell installed!" + +/obj/item/twohanded/required/electrostaff/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/stock_parts/cell)) + var/obj/item/stock_parts/cell/C = W + if(cell) + to_chat(user, "[src] already has a cell!") + else + if(C.maxcharge < hitcost) + to_chat(user, "[src] requires a higher capacity cell.") + return + if(!user.transferItemToLoc(W, src)) + return + cell = C + to_chat(user, "You install a cell in [src].") + + else if(W.tool_behaviour == TOOL_SCREWDRIVER) + if(cell) + cell.update_icon() + cell.forceMove(get_turf(src)) + cell= null + to_chat(user, "You remove the cell from [src].") + depower(user) + else + return ..() + +/obj/item/melee/twohanded/required/electrostaff/process() + deductcharge(50) //Wasteful! + +/obj/item/melee/twohanded/required/electrostaff/proc/deductcharge(amount) + var/obj/item/stock_parts/cell/C = get_cell() + if(!C) + turn_off() + return FALSE + C.use(min(amount, C.charge)) + if(QDELETED(src)) + return FALSE + if(C.charge < min_hit_cost()) + turn_off() + +/obj/item/twohanded/required/electrostaff/attack(mob/living/target, mob/living/user) + if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)//CIT CHANGE - makes it impossible to baton in stamina softcrit + to_chat(user, "You're too exhausted for that.")//CIT CHANGE - ditto + return //CIT CHANGE - ditto + if(status && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)) + if(on) + clowning_around(user) //ouch! + return + else + return ..(user, user) //beat yourself + if(iscyborg(target)) + ..() + return + if(target.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK)) //No message; check_shields() handles that + playsound(L, 'sound/weapons/genhit.ogg', 50, 1) + return FALSE + if(user.a_intent != INTENT_HARM) + if(stun_act(target, user)) + user.do_attack_animation(M) + user.adjustStaminaLossBuffered(stun_stam_cost) + return + else if(!harm_act(target, user)) + return ..() //if you can't fry them just beat them with it + else //we did harm act them + user.do_attack_animation(M) + user.adjustStaminaLossBuffered(harm_stam_cost) + +/obj/item/twohanded/required/electrostaff/proc/stun_act(mob/living/target, mob/living/user, no_charge_and_force = FALSE) + var/stunforce = stun_stamdmg + if(!no_charge_and_force) + if(!on) + target.visible_message("[user] has bapped [target] with [src]. Luckily it was off.", \ + "[user] has bapped you with [src]. Luckily it was off") + turn_off() //if it wasn't already off + return FALSE + var/obj/item/stock_parts/cell/C = get_cell() + var/chargeleft = C.charge + deductcharge(stun_cost) + if(QDELETED(src) || QDELETED(C)) //boom + return FALSE + if(chargeleft < stun_cost) + stunforce *= round(chargeleft/stun_cost, 0.1) + target.adjustStaminaLoss(stunforce) + target.apply_effect(EFFECT_STUTTER, stunforce) + SEND_SIGNAL(target, COMSIG_LIVING_MINOR_SHOCK) + if(user) + target.lastattacker = user.real_name + target.lastattackerckey = user.ckey + target.visible_message("[user] has shocked [user] with [src]!", \ + "[user] has shocked you with [src]!") + log_combat(user, user, "stunned with an electrostaff") + playsound(src, 'sound/weapons/staff.ogg', 50, 1, -1) + target.apply_status_effect(stun_status_effect, stun_status_duration) + if(ishuman(user)) + var/mob/living/carbon/human/H = user + H.forcesay(GLOB.hit_appends) + return TRUE + +/obj/item/twohanded/required/electrostaff/proc/harm_act(mob/living/target, mob/living/user, no_charge_and_force = FALSE) + var/lethal_force = lethal_damage + if(!no_charge_and_force) + if(!on) + return FALSE //standard item attack + var/obj/item/stock_parts/cell/C = get_cell() + var/chargeleft = C.charge + deductcharge(lethal_cost) + if(QDELETED(src) || QDELETED(C)) //boom + return FALSE + if(chargeleft < stun_cost) + lethal_force *= round(chargeleft/lethal_cost, 0.1) + target.adjustBurnLoss(lethal_force) //good against ointment spam + SEND_SIGNAL(target, COMSIG_LIVING_MINOR_SHOCK) + if(user) + target.lastattacker = user.real_name + target.lastattackerckey = user.ckey + target.visible_message("[user] has seared [user] with [src]!", \ + "[user] has seared you with [src]!") + log_combat(user, user, "burned with an electrostaff") + playsound(src, 'sound/weapons/sear.ogg', 50, 1, -1) + return TRUE + +/obj/item/twohanded/required/electrostaff/proc/clowning_around(mob/living/user) + user.visible_message("[user] accidentally hits [user.p_them()]self with [src]!", \ + "You accidentally hit yourself with [src]!") + SEND_SIGNAL(user, COMSIG_LIVING_MINOR_SHOCK) + lethal_act(user, user, TRUE) + stun_act(user, user, TRUE) + deductcharge(lethal_cost) + +/obj/item/twohanded/required/electrostaff/emp_act(severity) + . = ..() + if (!(. & EMP_PROTECT_SELF)) + turn_off() + if(!iscyborg(loc)) + deductcharge(1000 / severity, TRUE, FALSE) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm index 1517b30d9c..43021f3528 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm @@ -282,12 +282,15 @@ new /obj/item/clothing/head/helmet/alt(src) new /obj/item/clothing/mask/gas/sechailer(src) new /obj/item/clothing/suit/armor/bulletproof(src) + /obj/structure/closet/secure_closet/lethalshots name = "shotgun lethal rounds" req_access = list(ACCESS_ARMORY) icon_state = "tac" /obj/structure/closet/secure_closet/lethalshots/PopulateContents() ..() + new /obj/item/twohanded/required/electrostaff(src) + new /obj/item/twohanded/required/electrostaff(src) for(var/i in 1 to 3) new /obj/item/storage/box/lethalshot(src) diff --git a/icons/mob/inhands/weapons/estaff_lefthand.dmi b/icons/mob/inhands/weapons/estaff_lefthand.dmi new file mode 100644 index 0000000000..8b9ef642a4 Binary files /dev/null and b/icons/mob/inhands/weapons/estaff_lefthand.dmi differ diff --git a/icons/mob/inhands/weapons/estaff_righthand.dmi b/icons/mob/inhands/weapons/estaff_righthand.dmi new file mode 100644 index 0000000000..ea20dd2246 Binary files /dev/null and b/icons/mob/inhands/weapons/estaff_righthand.dmi differ diff --git a/icons/obj/estaff.dmi b/icons/obj/estaff.dmi new file mode 100644 index 0000000000..4c1a678802 Binary files /dev/null and b/icons/obj/estaff.dmi differ diff --git a/sound/weapons/staff.ogg b/sound/weapons/staff.ogg new file mode 100644 index 0000000000..35b42dfd8d Binary files /dev/null and b/sound/weapons/staff.ogg differ