Skip to content

Commit

Permalink
Ledgermain and Cane Office Fix (#1505)
Browse files Browse the repository at this point in the history
Pain
  • Loading branch information
scionalu authored Oct 7, 2023
1 parent 14e1baf commit 75ad259
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 29 deletions.
27 changes: 6 additions & 21 deletions code/game/objects/items/ego_weapons/he.dm
Original file line number Diff line number Diff line change
Expand Up @@ -716,28 +716,13 @@
)

/obj/item/ego_weapon/shield/legerdemain/attack_self(mob/user)//FIXME: Find a better way to use this override!
if (!ishuman(user))
return FALSE
if (block == 0)
var/mob/living/carbon/human/shield_user = user
if(!CanUseEgo(shield_user))
return FALSE
if(shield_user.physiology.armor.bomb)
to_chat(shield_user,"<span class='warning'>You're still off-balance!</span>")
if(block == 0) //Extra check because shields returns nothing on 1
if(..())
RegisterSignal(user, COMSIG_ATOM_ATTACK_HAND, .proc/NoParry, override = TRUE)//creates runtimes without overrides, double check if something's fucked
RegisterSignal(user, COMSIG_PARENT_ATTACKBY, .proc/NoParry, override = TRUE)//728 and 729 must be able to unregister the signal of 730
return TRUE
else
return FALSE
for(var/obj/machinery/computer/abnormality/AC in range(1, shield_user))
if(AC.datum_reference.working) // No blocking during work.
to_chat(shield_user,"<span class='notice'>You cannot defend yourself from responsibility!</span>")
return FALSE
block = TRUE
block_success = FALSE
shield_user.physiology.armor = shield_user.physiology.armor.modifyRating(red = reductions[1], white = reductions[2], black = reductions[3], pale = reductions[4], bomb = 1)
RegisterSignal(user, COMSIG_ATOM_ATTACK_HAND, .proc/NoParry, override = TRUE)//creates runtimes without overrides, double check if something's fucked
RegisterSignal(user, COMSIG_PARENT_ATTACKBY, .proc/NoParry, override = TRUE)//728 and 729 must be able to unregister the signal of 730
RegisterSignal(user, COMSIG_MOB_APPLY_DAMGE, .proc/AnnounceBlock)
addtimer(CALLBACK(src, .proc/DisableBlock, shield_user), block_duration)
to_chat(user,"<span class='userdanger'>[block_message]</span>")
return TRUE

/obj/item/ego_weapon/shield/legerdemain/proc/NoParry(mob/living/carbon/human/user, obj/item/L)//Disables AnnounceBlock when attacked by an item or a human
SIGNAL_HANDLER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,22 @@
return FALSE
block = TRUE
block_success = FALSE
shield_user.physiology.armor = shield_user.physiology.armor.modifyRating(red = reductions[1], white = reductions[2], black = reductions[3], pale = reductions[4], bomb = 1) //bomb defense must be over 0
shield_user.physiology.armor = shield_user.physiology.armor.modifyRating(bomb = 1) //bomb defense must be over 0
shield_user.physiology.red_mod *= max(0.001, (1 - ((reductions[1]) / 100)))
shield_user.physiology.white_mod *= max(0.001, (1 - ((reductions[2]) / 100)))
shield_user.physiology.black_mod *= max(0.001, (1 - ((reductions[3]) / 100)))
shield_user.physiology.pale_mod *= max(0.001, (1 - ((reductions[4]) / 100)))
RegisterSignal(user, COMSIG_MOB_APPLY_DAMGE, .proc/AnnounceBlock)
addtimer(CALLBACK(src, .proc/DisableBlock, shield_user), 1 SECONDS)
to_chat(user,"<span class='userdanger'>You attempt to parry the attack!</span>")
return TRUE

/obj/item/ego_weapon/black_silence_gloves/old_boys/proc/DisableBlock(mob/living/carbon/human/user)
user.physiology.armor = user.physiology.armor.modifyRating(red = -reductions[1], white = -reductions[2], black = -reductions[3], pale = -reductions[4], bomb = -1)
user.physiology.armor = user.physiology.armor.modifyRating(bomb = -1)
user.physiology.red_mod /= max(0.001, (1 - ((reductions[1]) / 100)))
user.physiology.white_mod /= max(0.001, (1 - ((reductions[2]) / 100)))
user.physiology.black_mod /= max(0.001, (1 - ((reductions[3]) / 100)))
user.physiology.pale_mod /= max(0.001, (1 - ((reductions[4]) / 100)))
UnregisterSignal(user, COMSIG_MOB_APPLY_DAMGE)
buff_check = FALSE
addtimer(CALLBACK(src, .proc/BlockCooldown, user), 3 SECONDS)
Expand Down
13 changes: 7 additions & 6 deletions code/game/objects/items/ego_weapons/non_abnormality/cane.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
/obj/item/ego_weapon/city/charge/cane/attack_self(mob/user)
..()
if(charge>=charge_cost)
release_charge(user)
var/target //Didn't even need new var, could literally put anything for first arg, but for consistency sake and less confusion
release_charge(target, user)
else
to_chat(user, "<span class='notice'>You don't have enough charge.</span>")

/obj/item/ego_weapon/city/charge/cane/release_charge(mob/living/user)
/obj/item/ego_weapon/city/charge/cane/release_charge(target, mob/living/user)
..()
sleep(2)
playsound(src, 'sound/abnormalities/thunderbird/tbird_bolt.ogg', 50, TRUE)
Expand All @@ -46,7 +47,7 @@
charge_effect = "heal yourself."
charge_cost = 8

/obj/item/ego_weapon/city/charge/cane/cane/release_charge(mob/living/carbon/human/user)
/obj/item/ego_weapon/city/charge/cane/cane/release_charge(target, mob/living/carbon/human/user)
..()
user.adjustBruteLoss(-user.maxHealth*0.07)
user.adjustSanityLoss(-user.maxSanity*0.07)
Expand Down Expand Up @@ -76,7 +77,7 @@
charge_cost = 3
var/dodgelanding

/obj/item/ego_weapon/city/charge/cane/claw/release_charge(mob/living/user)
/obj/item/ego_weapon/city/charge/cane/claw/release_charge(target, mob/living/user)
..()
if(user.dir == NORTH)
dodgelanding = locate(user.x, user.y + 5, user.z)
Expand All @@ -101,7 +102,7 @@
charge_effect = "boost this weapon's attack."
charge_cost = 8

/obj/item/ego_weapon/city/charge/cane/fist/release_charge(mob/living/carbon/human/user)
/obj/item/ego_weapon/city/charge/cane/fist/release_charge(target, mob/living/carbon/human/user)
..()
force = force*2
addtimer(CALLBACK(src, .proc/Return, user), 2 SECONDS)
Expand All @@ -121,7 +122,7 @@
charge_effect = "knock others backwards!"
charge_cost = 4

/obj/item/ego_weapon/city/charge/cane/briefcase/release_charge(mob/living/user)
/obj/item/ego_weapon/city/charge/cane/briefcase/release_charge(target, mob/living/user)
..()
goonchem_vortex(get_turf(src), 1, 4)

Expand Down

0 comments on commit 75ad259

Please sign in to comment.