diff --git a/code/game/gamemodes/factions.dm b/code/game/gamemodes/factions.dm index 363d43d5..dd1f3ba7 100644 --- a/code/game/gamemodes/factions.dm +++ b/code/game/gamemodes/factions.dm @@ -125,7 +125,7 @@ /obj/item/weapon/melee/energy/sword:4:Energy Sword; /obj/item/weapon/storage/box/syndicate:10:Syndicate Bundle; /obj/item/weapon/storage/box/emps:3:5 EMP Grenades; -/obj/item/weapon/melee/baton/stunrod:4:Stunrod; +/obj/item/weapon/melee/baton/stunrod/loaded:4:Stunrod; Whitespace:Seperator; Stealthy and Inconspicuous Weapons; /obj/item/weapon/pen/paralysis:3:Paralysis Pen; diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index acb858c8..16bb208e 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -37,7 +37,7 @@ /obj/item/weapon/melee/energy/sword:4:Energy Sword; /obj/item/weapon/storage/box/syndicate:10:Syndicate Bundle; /obj/item/weapon/storage/box/emps:3:5 EMP Grenades; -/obj/item/weapon/melee/baton/stunrod:4:Stunrod; +/obj/item/weapon/melee/baton/stunrod/loaded:4:Stunrod; Whitespace:Seperator; Stealthy and Inconspicuous Weapons; /obj/item/weapon/storage/box/walkingcane:5:Disguised Sword; diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 1e22bebb..5f757d72 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -91,15 +91,7 @@ obj/machinery/recharger/process() if(istype(charging, /obj/item/weapon/melee/baton)) var/obj/item/weapon/melee/baton/B = charging -//Should really update the baton to use cells - if(B.charges < initial(B.charges)) - B.charges++ - icon_state = "recharger1" - use_power(150) - else - icon_state = "recharger2" - -/* if(B.bcell) + if(B.bcell) if(!B.bcell.fully_charged()) icon_state = icon_state_charging B.bcell.give(active_power_usage*CELLRATE) @@ -110,7 +102,6 @@ obj/machinery/recharger/process() else icon_state = icon_state_idle update_use_power(1) -*/ return /* if(istype(charging, /obj/item/device/laptop)) @@ -147,12 +138,8 @@ obj/machinery/recharger/emp_act(severity) else if(istype(charging, /obj/item/weapon/melee/baton)) var/obj/item/weapon/melee/baton/B = charging - //same here - if(B.charges) - B.charges = 0 -/* if(B.bcell) + if(B.bcell) B.bcell.charge = 0 -*/ ..(severity) obj/machinery/recharger/update_icon() //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier. diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index 9870f88b..f052f111 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -30,7 +30,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid for(var/D in ItemList) var/list/O = text2list(D, ":") if(O.len>0) - valid_items += O[1] + valid_items += O[1] @@ -147,7 +147,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid randomItems.Add("/obj/item/weapon/melee/energy/sword") //Energy Sword randomItems.Add("/obj/item/clothing/mask/gas/voice") //Voice Changer randomItems.Add("/obj/item/device/chameleon") //Chameleon Projector - randomItems.Add("/obj/item/weapon/melee/baton/stunrod") //Stunrod + randomItems.Add("/obj/item/weapon/melee/baton/stunrod/loaded") //Stunrod if(uses > 2) randomItems.Add("/obj/item/weapon/storage/box/emps") //EMP Grenades @@ -198,7 +198,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid uses -= 6 if("/obj/item/weapon/gun/energy/crossbow" , "/obj/item/device/powersink" , "/obj/item/weapon/storage/box/walkingcane") uses -= 5 - if("/obj/item/weapon/melee/energy/sword" , "/obj/item/clothing/mask/gas/voice" , "/obj/item/device/chameleon" , "/obj/item/weapon/melee/baton/stunrod") + if("/obj/item/weapon/melee/energy/sword" , "/obj/item/clothing/mask/gas/voice" , "/obj/item/device/chameleon" , "/obj/item/weapon/melee/baton/stunrod/loaded") uses -= 4 if("/obj/item/weapon/storage/box/emps" , "/obj/item/weapon/pen/paralysis" , "/obj/item/weapon/cartridge/syndicate" , "/obj/item/clothing/under/chameleon" , \ "/obj/item/weapon/card/emag" , "/obj/item/weapon/storage/box/syndie_kit/space" , "/obj/item/device/encryptionkey/binary" , \ @@ -276,7 +276,7 @@ A list of items and costs is stored under the datum of every game mode, alongsid feedback_add_details("traitor_uplink_items_bought","GM") if("/obj/item/weapon/storage/box/syndie_kit/masks") feedback_add_details("traitor_uplink_items_bought","MM") - if("/obj/item/weapon/melee/baton/stunrod") + if("/obj/item/weapon/melee/baton/stunrod/loaded") feedback_add_details("traitor_uplink_items_bought","SR") diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index bddfda17..4d8d97d5 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -1,56 +1,105 @@ /obj/item/weapon/melee/baton - name = "stun baton" + name = "stunbaton" desc = "A stun baton for incapacitating people with." icon_state = "stunbaton" item_state = "baton" flags = FPRINT | TABLEPASS slot_flags = SLOT_BELT - force = 10 + force = 15 + sharp = 0 + edge = 0 throwforce = 7 w_class = 3 - var/charges = 10 - var/status = 0 - var/mob/foundmob = "" //Used in throwing proc. - origin_tech = "combat=2" + attack_verb = list("beaten") + var/status = 0 //whether the thing is on or not + var/obj/item/weapon/cell/bcell = null + var/hitcost = 1000 //oh god why do power cells carry so much charge? We probably need to make a distinction between "industrial" sized power cells for APCs and power cells for everything else. + var/mob/foundmob = "" //Throwing! And proc. - suicide_act(mob/user) - viewers(user) << "\red [user] is putting the live [src.name] in \his mouth! It looks like \he's trying to commit suicide." - return (FIRELOSS) +/obj/item/weapon/melee/baton/suicide_act(mob/user) + user.visible_message("[user] is putting the live [name] in \his mouth! It looks like \he's trying to commit suicide.") + return (FIRELOSS) + +/obj/item/weapon/melee/baton/New() + ..() + update_icon() + return + +/obj/item/weapon/melee/baton/loaded/New() //this one starts with a cell pre-installed. + ..() + bcell = new/obj/item/weapon/cell/high(src) + update_icon() + return + +/obj/item/weapon/melee/baton/proc/deductcharge(var/chrgdeductamt) + if(bcell) + if(bcell.use(chrgdeductamt)) + return 1 + else + status = 0 + update_icon() + return 0 /obj/item/weapon/melee/baton/update_icon() if(status) - icon_state = "stunbaton_active" + icon_state = "[initial(name)]_active" + else if(!bcell) + icon_state = "[initial(name)]_nocell" else - icon_state = "stunbaton" + icon_state = "[initial(name)]" -/obj/item/weapon/melee/baton/attack_self(mob/user as mob) - if(status && (CLUMSY in user.mutations) && prob(50)) - user << "\red You grab the [src] on the wrong side." - user.Weaken(30) - charges-- - if(charges < 1) +/obj/item/weapon/melee/baton/examine() + set src in view(1) + ..() + if(bcell) + usr <<"The baton is [round(bcell.percent())]% charged." + if(!bcell) + usr <<"The baton does not have a power source installed." + +/obj/item/weapon/melee/baton/attackby(obj/item/weapon/W, mob/user) + if(istype(W, /obj/item/weapon/cell)) + if(!bcell) + user.drop_item() + W.loc = src + bcell = W + user << "You install a cell in [src]." + update_icon() + else + user << "[src] already has a cell." + + else if(istype(W, /obj/item/weapon/screwdriver)) + if(bcell) + bcell.updateicon() + bcell.loc = get_turf(src.loc) + bcell = null + user << "You remove the cell from the [src]." status = 0 update_icon() - return - if(charges > 0) + return + ..() + return + +/obj/item/weapon/melee/baton/attack_self(mob/user) + if(bcell && bcell.charge > hitcost) status = !status - user << "\The [src] is now [status ? "on" : "off"]." - playsound(src.loc, "sparks", 75, 1, -1) + user << "[src] is now [status ? "on" : "off"]." + playsound(loc, "sparks", 75, 1, -1) update_icon() else status = 0 - user << "\The [src] is out of charge." + if(!bcell) + user << "[src] does not have a power source!" + else + user << "[src] is out of charge." add_fingerprint(user) -/obj/item/weapon/melee/baton/attack(mob/M as mob, mob/user as mob) + +/obj/item/weapon/melee/baton/attack(mob/M, mob/user) if(status && (CLUMSY in user.mutations) && prob(50)) user << "You accidentally hit yourself with the [src]!" user.Weaken(30) - charges-- - if(charges < 1) - status = 0 - update_icon() + deductcharge(hitcost) return var/mob/living/carbon/human/H = M @@ -61,15 +110,15 @@ if(user.a_intent == "hurt") if(!..()) return //H.apply_effect(5, WEAKEN, 0) - H.visible_message("[M] has been beaten with the [src] by [user]!") + M.visible_message("[M] has been beaten with the [src] by [user]!") - user.attack_log += "\[[time_stamp()]\] Beat [H.name] ([H.ckey]) with [src.name]" - H.attack_log += "\[[time_stamp()]\] Beaten by [user.name] ([user.ckey]) with [src.name]" - msg_admin_attack("[user.name] ([user.ckey]) beat [H.name] ([H.ckey]) with [src.name] (JMP)") + user.attack_log += "\[[time_stamp()]\] Beat [M.name] ([M.ckey]) with [src.name]" + M.attack_log += "\[[time_stamp()]\] Beaten by [user.name] ([user.ckey]) with [src.name]" + msg_admin_attack("[user.name] ([user.ckey]) beat [M.name] ([M.ckey]) with [src.name] (JMP)") - playsound(src.loc, "swing_hit", 50, 1, -1) + playsound(loc, "swing_hit", 50, 1, -1) else if(!status) - H.visible_message("[M] has been prodded with the [src] by [user]. Luckily it was off.") + M.visible_message("[M] has been prodded with the [src] by [user]. Luckily it was off.") return if(status) @@ -77,21 +126,21 @@ H.apply_effect(10, WEAKEN, 0) H.apply_effect(10, STUTTER, 0) user.lastattacked = M - H.lastattacker = user + M.lastattacker = user if(isrobot(src.loc)) var/mob/living/silicon/robot/R = src.loc if(R && R.cell) R.cell.use(50) else - charges-- - H.visible_message("[M] has been stunned with the [src] by [user]!") + deductcharge(hitcost) + M.visible_message("[M] has been stunned with the [src] by [user]!") - user.attack_log += "\[[time_stamp()]\] Stunned [H.name] ([H.ckey]) with [src.name]" - H.attack_log += "\[[time_stamp()]\] Stunned by [user.name] ([user.ckey]) with [src.name]" - msg_admin_attack("[key_name(user)] stunned [key_name(H)] with [src.name] - JMP") + user.attack_log += "\[[time_stamp()]\] Stunned [M.name] ([M.ckey]) with [src.name]" + M.attack_log += "\[[time_stamp()]\] Stunned by [user.name] ([user.ckey]) with [src.name]" + msg_admin_attack("[key_name(user)] stunned [key_name(M)] with [src.name] - JMP") playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) - if(charges < 1) + if(bcell && bcell.charge < hitcost) status = 0 update_icon() @@ -106,7 +155,7 @@ H.apply_effect(10, STUN, 0) H.apply_effect(10, WEAKEN, 0) H.apply_effect(10, STUTTER, 0) - charges-- + deductcharge(hitcost) for(var/mob/M in player_list) if(M.key == src.fingerprintslast) foundmob = M @@ -118,15 +167,20 @@ msg_admin_attack("Flying [src.name], last touched by ([src.fingerprintslast]) stunned [key_name(H)] - JMP" ) /obj/item/weapon/melee/baton/emp_act(severity) - switch(severity) - if(1) - charges = 0 - if(2) - charges = max(0, charges - 5) - if(charges < 1) - status = 0 - update_icon() + if(bcell) + bcell.emp_act(severity) //let's not duplicate code everywhere if we don't have to please. + ..() +//secborg stun baton module +/obj/item/weapon/melee/baton/robot/attack_self(mob/user) + //try to find our power cell + var/mob/living/silicon/robot/R = loc + if (istype(R)) + bcell = R.cell + return ..() + +/obj/item/weapon/melee/baton/robot/attackby(obj/item/weapon/W, mob/user) + return /* * @@ -137,133 +191,19 @@ */ /obj/item/weapon/melee/baton/stunrod - name = "stun rod" + name = "stunrod" desc = "A more-than-lethal weapon used to deal with high threat situations." icon_state = "stunrod" item_state = "stunrod" flags = FPRINT | TABLEPASS slot_flags = SLOT_BELT - force = 12 + force = 15 throwforce = 8 w_class = 3 - origin_tech = "combat=4,illegal=2" - suicide_act(mob/user) - viewers(user) << "\red [user] is putting the live [src.name] in \his mouth! It looks like \he's trying to commit suicide." - return (FIRELOSS) - -/obj/item/weapon/melee/baton/stunrod/update_icon() - if(status) - icon_state = "stunrod_active" - item_state = "stunrod_active" - else - icon_state = "stunrod" - item_state = "stunrod" - -/obj/item/weapon/melee/baton/stunrod/attack_self(mob/user as mob) - if(status && (CLUMSY in user.mutations) && prob(50)) - user << "\red You grab the [src] on the wrong side and burn yourself." - user.Weaken(40) - charges-- - if(charges < 1) - status = 0 - update_icon() - return - if(charges > 0) - status = !status - user << "\The [src] is now [status ? "on" : "off"]." - playsound(src.loc, "sparks", 75, 1, -1) - update_icon() - else - status = 0 - user << "\The [src] is out of charge." - add_fingerprint(user) - -/obj/item/weapon/melee/baton/stunrod/attack(mob/M as mob, mob/user as mob) - if(status && (CLUMSY in user.mutations) && prob(50)) - user << "You accidentally hit yourself with the [src]!" - user.Weaken(20) -// user.apply_damage(10,BURN) - charges-- - if(charges < 1) - status = 0 - update_icon() - return - - var/mob/living/carbon/human/H = M - if(isrobot(M)) - ..() - return - - if(user.a_intent == "hurt") - if(!..()) return - H.apply_effect(5, WEAKEN, 0) - H.apply_damage(15, BURN) - H.visible_message("[M] has been beaten with the [src] by [user]!") - - user.attack_log += "\[[time_stamp()]\] Beat [H.name] ([H.ckey]) with [src.name]" - H.attack_log += "\[[time_stamp()]\] Beaten by [user.name] ([user.ckey]) with [src.name]" - msg_admin_attack("[user.name] ([user.ckey]) beat [H.name] ([H.ckey]) with [src.name] (JMP)") - - playsound(src.loc, "swing_hit", 50, 1, -1) - else if(!status) - H.visible_message("[M] has been prodded with the [src] by [user]. Luckily it was off.") - return - - if(status) - H.apply_effect(5, STUN, 0) - H.apply_effect(5, WEAKEN, 0) - H.apply_effect(5, STUTTER, 0) - H.apply_damage(15, BURN) - user.lastattacked = M - H.lastattacker = user - if(isrobot(src.loc)) - var/mob/living/silicon/robot/R = src.loc - if(R && R.cell) - R.cell.use(75) - else - charges-- - H.visible_message("[M] has been stunned with the [src] by [user]!") - - user.attack_log += "\[[time_stamp()]\] Stunned [H.name] ([H.ckey]) with [src.name]" - H.attack_log += "\[[time_stamp()]\] Stunned by [user.name] ([user.ckey]) with [src.name]" - msg_admin_attack("[key_name(user)] stunned [key_name(H)] with [src.name] - JMP") - - playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) - if(charges < 1) - status = 0 - update_icon() - - add_fingerprint(user) - -/obj/item/weapon/melee/baton/stunrod/throw_impact(atom/hit_atom) - . = ..() - if (prob(50)) - if(istype(hit_atom, /mob/living)) - var/mob/living/carbon/human/H = hit_atom - if(status) - H.apply_effect(5, STUN, 0) - H.apply_effect(5, WEAKEN, 0) - H.apply_effect(5, STUTTER, 0) - H.apply_damage(15, BURN) - charges-- - - for(var/mob/M in player_list) if(M.key == src.fingerprintslast) - foundmob = M - break - - H.visible_message("[src], thrown by [foundmob.name], strikes [H] and stuns them!") - - H.attack_log += "\[[time_stamp()]\] Stunned by thrown [src.name] last touched by ([src.fingerprintslast])" - msg_admin_attack("Flying [src.name], last touched by ([src.fingerprintslast]) stunned [key_name(H)] - JMP" ) - -/obj/item/weapon/melee/baton/stunrod/emp_act(severity) - switch(severity) - if(1) - charges = 0 - if(2) - charges = max(0, charges - 5) - if(charges < 1) - status = 0 - update_icon() \ No newline at end of file +/obj/item/weapon/melee/baton/stunrod/loaded/New() //this one starts with a cell pre-installed. + ..() + bcell = new/obj/item/weapon/cell/high(src) + update_icon() + return 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 58da2b2a..0104167a 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm @@ -119,7 +119,7 @@ new /obj/item/weapon/storage/box/flashbangs(src) new /obj/item/weapon/storage/belt/security(src) new /obj/item/device/flash(src) - new /obj/item/weapon/melee/baton(src) + new /obj/item/weapon/melee/baton/loaded(src) new /obj/item/weapon/gun/energy/gun/pistol(src) new /obj/item/clothing/tie/holster/waist(src) new /obj/item/weapon/melee/telebaton(src) @@ -157,7 +157,7 @@ new /obj/item/weapon/storage/box/flashbangs(src) new /obj/item/weapon/storage/belt/security(src) new /obj/item/weapon/reagent_containers/spray/pepper(src) - new /obj/item/weapon/melee/baton(src) + new /obj/item/weapon/melee/baton/loaded(src) new /obj/item/weapon/gun/energy/taser(src) new /obj/item/weapon/storage/box/holobadge(src) return @@ -189,7 +189,7 @@ new /obj/item/device/flash(src) new /obj/item/weapon/reagent_containers/spray/pepper(src) new /obj/item/weapon/grenade/flashbang(src) - new /obj/item/weapon/melee/baton(src) + new /obj/item/weapon/melee/baton/loaded(src) new /obj/item/weapon/gun/energy/taser(src) new /obj/item/clothing/glasses/sunglasses/sechud(src) new /obj/item/taperoll/police(src) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index adde9371..e106b08f 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -370,20 +370,21 @@ else if (istype(O, /obj/item/weapon/melee/baton)) var/obj/item/weapon/melee/baton/B = O - if (B.charges > 0 && B.status == 1) - flick("baton_active", src) - user.Stun(10) - user.stuttering = 10 - user.Weaken(10) - if(isrobot(user)) - var/mob/living/silicon/robot/R = user - R.cell.charge -= 20 - else - B.charges-- - user.visible_message( \ - "[user] was stunned by his wet [O].", \ - "\red You have wet \the [O], it shocks you!") - return + if(B.bcell) + if(B.bcell.charge > 0 && B.status == 1) + flick("baton_active", src) + user.Stun(10) + user.stuttering = 10 + user.Weaken(10) + if(isrobot(user)) + var/mob/living/silicon/robot/R = user + R.cell.charge -= 20 + else + B.deductcharge(B.hitcost) + user.visible_message( \ + "[user] was stunned by \his wet [O]!", \ + "[user] was stunned by \his wet [O]!") + return var/turf/location = user.loc if(!isturf(location)) return @@ -429,4 +430,4 @@ /obj/structure/sink/puddle/attackby(obj/item/O as obj, mob/user as mob) icon_state = "puddle-splash" ..() - icon_state = "puddle" \ No newline at end of file + icon_state = "puddle" diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index 2a50ed46..67842318 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -292,6 +292,7 @@ icon_state = "tool_flask" volume = 60 +/* /obj/item/weapon/melee/baton/fluff/omnivac_baton //Tiger Claw - Zander Moon - omnivac - DONE name = "Tiger Claw" desc = "A small energy dagger given to Golden Tigers meant to incapacitate people quickly." @@ -325,7 +326,7 @@ status = 0 user << "\The [src] is out of charge." add_fingerprint(user) - +*/ /* /obj/item/device/modkit/fluff/omnivac_modkit //Ornate box - Zander Moon - omnivac - SPRITE name = "ornate box" diff --git a/icons/obj/weapons.dmi b/icons/obj/weapons.dmi index 47dc4319..22b852c2 100644 Binary files a/icons/obj/weapons.dmi and b/icons/obj/weapons.dmi differ