Skip to content

Commit

Permalink
Fixes buster arm runtime and errors (yogstation13#21877)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnFulpWillard authored Apr 16, 2024
1 parent 2265ef9 commit 01ee569
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions code/datums/martial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
if(!istype(H) || !H.mind || H.mind.martial_art != src)
return
on_remove(H)
H.mind.martial_art = null
if(base)
base.teach(H)
else
Expand Down
15 changes: 7 additions & 8 deletions code/game/objects/items/devices/busterarm/buster_limb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@
icon_state = "left_buster_arm"
max_damage = 50
aux_layer = 12
var/obj/item/bodypart/r_arm/robot/buster/opphand
var/datum/action/cooldown/buster/megabuster/l/megabuster_action = new/datum/action/cooldown/buster/megabuster/l()
var/datum/martial_art/buster_style/buster_style = new

/// Set up our actions, disable gloves
/obj/item/bodypart/l_arm/robot/buster/attach_limb(mob/living/carbon/N, special)
. = ..()
megabuster_action.Grant(N)
buster_style.teach(N)
if(N.mind.martial_art.type != buster_style) //you've already got buster style.
buster_style.teach(N)
to_chat(owner, "[span_boldannounce("You've gained the ability to use Buster Style!")]")

/// Remove our actions, re-enable gloves
/obj/item/bodypart/l_arm/robot/buster/drop_limb(special)
var/mob/living/carbon/N = owner
var/obj/item/bodypart/r_arm = N.get_bodypart(BODY_ZONE_R_ARM)
megabuster_action.Remove(N)
if(!istype(r_arm, /obj/item/bodypart/r_arm/robot/buster))
if(!istype(r_arm, /obj/item/bodypart/r_arm/robot/buster)) //got another arm, don't remove it then.
buster_style.remove(N)
N.click_intercept = null
to_chat(owner, "[span_boldannounce("You've lost the ability to use Buster Style...")]")
Expand All @@ -44,7 +44,7 @@
return
if(!ishuman(L))
return
if(L.mind.martial_art.type in subtypesof(/datum/martial_art) && !(istype(L.mind.martial_art, /datum/martial_art/cqc/under_siege))) //prevents people from learning several martial arts or swapping between them
if((L.mind.martial_art != L.mind.default_martial_art) && !(istype(L.mind.martial_art, /datum/martial_art/cqc/under_siege))) //prevents people from learning several martial arts or swapping between them
to_chat(L, span_warning("You are already dedicated to using [L.mind.martial_art.name]!"))
return
playsound(L,'sound/effects/phasein.ogg', 20, 1)
Expand All @@ -54,7 +54,7 @@
/// Using the arm in-hand switches the arm it replaces
/obj/item/bodypart/l_arm/robot/buster/attack_self(mob/user)
. = ..()
opphand = new /obj/item/bodypart/r_arm/robot/buster(get_turf(src))
var/obj/item/bodypart/r_arm/robot/buster/opphand = new(get_turf(src))
opphand.brute_dam = src.brute_dam
opphand.burn_dam = src.burn_dam
to_chat(user, span_notice("You modify [src] to be installed on the right arm."))
Expand All @@ -68,7 +68,6 @@
icon_state = "right_buster_arm"
max_damage = 50
aux_layer = 12
var/obj/item/bodypart/l_arm/robot/buster/opphand
var/datum/action/cooldown/buster/megabuster/r/megabuster_action = new/datum/action/cooldown/buster/megabuster/r()
var/datum/martial_art/buster_style/buster_style = new

Expand Down Expand Up @@ -96,7 +95,7 @@
return
if(!ishuman(L))
return
if(L.mind.martial_art.type in subtypesof(/datum/martial_art) && !(istype(L.mind.martial_art, /datum/martial_art/cqc/under_siege))) //prevents people from learning several martial arts or swapping between them
if((L.mind.martial_art != L.mind.default_martial_art) && !(istype(L.mind.martial_art, /datum/martial_art/cqc/under_siege))) //prevents people from learning several martial arts or swapping between them
to_chat(L, span_warning("You are already dedicated to using [L.mind.martial_art.name]!"))
return
playsound(L,'sound/effects/phasein.ogg', 20, 1)
Expand All @@ -106,7 +105,7 @@
/// Using the arm in-hand switches the arm it replaces
/obj/item/bodypart/r_arm/robot/buster/attack_self(mob/user)
. = ..()
opphand = new /obj/item/bodypart/l_arm/robot/buster(get_turf(src))
var/obj/item/bodypart/l_arm/robot/buster/opphand = new(get_turf(src))
opphand.brute_dam = src.brute_dam
opphand.burn_dam = src.burn_dam
to_chat(user, span_notice("You modify [src] to be installed on the left arm."))
Expand Down

0 comments on commit 01ee569

Please sign in to comment.