Skip to content

Commit

Permalink
code review thingys
Browse files Browse the repository at this point in the history
  • Loading branch information
Constellado committed Aug 31, 2024
1 parent 7020713 commit 3f4941f
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@
burn_modifier = 0.1

/obj/item/sunscreen/attack_self(mob/user)
apply(user, user)
if(ishuman(user) && user.is_holding(src))
apply(user, user)

/obj/item/sunscreen/examine()
. = ..()
. += span_info("It's labeled SPF [burn_modifier * 1000]. Reapply in [reaplication_time / 600] minutes.")

/obj/item/sunscreen/interact_with_atom(atom/target, mob/living/user)
if(!ishuman(target))
return NONE
apply(target, user)
return ITEM_INTERACT_SUCCESS

Expand All @@ -78,9 +81,12 @@
span_notice("You begin applying [src] on [target]...")
)

if(do_after(user, application_time, user))
if(do_after(user, application_time, target))
target.apply_status_effect(/datum/status_effect/sunscreen, reaplication_time, burn_modifier)

target.visible_message(span_warning("[target] has applied sunscreen!"),
span_notice("You are covered in sunscreen!"))

//sunscreen status effect
/atom/movable/screen/alert/status_effect/sunscreen
name = "Sunscreen"
Expand All @@ -101,10 +107,8 @@

/datum/status_effect/sunscreen/on_apply()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.physiology.burn_mod -= burn_modifier
owner.visible_message(span_warning("[owner] has applied sunscreen!"),
span_notice("You are covered in sunscreen!"))
var/mob/living/carbon/human/applying_to = owner
applying_to.physiology.burn_mod -= burn_modifier
return ..()

///Stuff that happens when the sunscreen runs out.
Expand Down

0 comments on commit 3f4941f

Please sign in to comment.