Files
Bubberstation/code/modules/projectiles/guns/magic.dm
Ghom 17b3091867 Merges tinfoil (hat) protection into the anti_magic component. Implements it on Hivemind gamemode and telepathy. (#43978)
About The Pull Request

Was fairly shocked to find out hiveminds never took tinfoil hat protection in account, so decided to implement the factor in the game mode. Might have overdone it and probably erroneously changed a couple logics while getting rid of some really indented passages that could easily early return.
So what's said on the tin, this is lot more preferable than clunky is_type() checks on headwear anyway.
Also expanded tinfoil protection to hivemind and (non-revenant) telepathy.
Why It's Good For The Game

Let us remember the "purpose" of tinfoil hats.
Changelog

cl
code: Merged tinfoil hat kind of protection into the anti_magic component.
add: Tinfoil hats can also be warped up from excessive dampening of mindray/though control/psicotronic anomalies, or by simply being microwaved in an oven, and become useless.
add: Immortality Talisman and Paranormal Hardsuit helmets now come with tinfoil protection too (minus the paranoia and limited charges).
balance: Rebalanced many hivemind effects to be dampened/delayed by tinfoil shielding. Bruteforced Assimilate Vessel, One mind and Awake Vessel abilities will consume more tinfoil charges compared to others.
balance: Genetics/Slime/Alien Telepathy and Slime Link are now stopped by tinfoil protection.
/cl
2019-05-30 20:29:30 +12:00

94 lines
3.0 KiB
Plaintext

/obj/item/gun/magic
name = "staff of nothing"
desc = "This staff is boring to watch because even though it came first you've seen everything it can do in other staves for years."
icon = 'icons/obj/guns/magic.dmi'
icon_state = "staffofnothing"
item_state = "staff"
lefthand_file = 'icons/mob/inhands/weapons/staves_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/staves_righthand.dmi'
fire_sound = 'sound/weapons/emitter.ogg'
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_HUGE
var/checks_antimagic = TRUE
var/max_charges = 6
var/charges = 0
var/recharge_rate = 4
var/charge_tick = 0
var/can_charge = TRUE
var/ammo_type
var/no_den_usage
clumsy_check = 0
trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses magic instead
pin = /obj/item/firing_pin/magic
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' //not really a gun and some toys use these inhands
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
/obj/item/gun/magic/process_fire(atom/target, mob/living/user, message, params, zone_override, bonus_spread)
if(no_den_usage)
var/area/A = get_area(user)
if(istype(A, /area/wizard_station))
add_fingerprint(user)
to_chat(user, "<span class='warning'>You know better than to violate the security of The Den, best wait until you leave to use [src].</span>")
return
else
no_den_usage = 0
if(checks_antimagic && user.anti_magic_check(TRUE, FALSE, FALSE, 0, TRUE))
add_fingerprint(user)
to_chat(user, "<span class='warning'>Something is interfering with [src].</span>")
return
. = ..()
/obj/item/gun/magic/can_shoot()
return charges
/obj/item/gun/magic/recharge_newshot()
if (charges && chambered && !chambered.BB)
chambered.newshot()
/obj/item/gun/magic/process_chamber()
if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired...
charges--//... drain a charge
recharge_newshot()
/obj/item/gun/magic/Initialize()
. = ..()
charges = max_charges
chambered = new ammo_type(src)
if(can_charge)
START_PROCESSING(SSobj, src)
/obj/item/gun/magic/Destroy()
if(can_charge)
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/gun/magic/process()
charge_tick++
if(charge_tick < recharge_rate || charges >= max_charges)
return 0
charge_tick = 0
charges++
if(charges == 1)
recharge_newshot()
return 1
/obj/item/gun/magic/update_icon()
return
/obj/item/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
to_chat(user, "<span class='warning'>The [name] whizzles quietly.</span>")
/obj/item/gun/magic/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is twisting [src] above [user.p_their()] head, releasing a magical blast! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(loc, fire_sound, 50, 1, -1)
return (FIRELOSS)
/obj/item/gun/magic/vv_edit_var(var_name, var_value)
. = ..()
switch (var_name)
if ("charges")
recharge_newshot()