Skip to content

Commit

Permalink
Improves collector feedback (tgstation#27595)
Browse files Browse the repository at this point in the history
  • Loading branch information
QualityVan authored and lzimann committed May 24, 2017
1 parent 9680a54 commit 5cc9387
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions code/modules/power/singularity/collector.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ GLOBAL_LIST_EMPTY(rad_collectors)
toggle_power()
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
"<span class='notice'>You turn the [src.name] [active? "on":"off"].</span>")
var/fuel = loaded_tank.air_contents.gases["plasma"]
var/fuel
if(loaded_tank)
fuel = loaded_tank.air_contents.gases["plasma"]
fuel = fuel ? fuel[MOLES] : 0
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [loaded_tank?"Fuel: [round(fuel/0.29)]%":"<font color='red'>It is empty</font>"].", INVESTIGATE_SINGULO)
return
Expand All @@ -73,28 +75,34 @@ GLOBAL_LIST_EMPTY(rad_collectors)
/obj/machinery/power/rad_collector/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/device/multitool))
to_chat(user, "<span class='notice'>The [W.name] detects that [last_power]W were recently produced.</span>")
return 1
return TRUE
else if(istype(W, /obj/item/device/analyzer) && loaded_tank)
atmosanalyzer_scan(loaded_tank.air_contents, user)
else if(istype(W, /obj/item/weapon/tank/internals/plasma))
if(!anchored)
to_chat(user, "<span class='warning'>The [src] needs to be secured to the floor first!</span>")
return 1
return TRUE
if(loaded_tank)
to_chat(user, "<span class='warning'>There's already a plasma tank loaded!</span>")
return 1
return TRUE
if(!user.drop_item())
return 1
return TRUE
loaded_tank = W
W.forceMove(src)
update_icons()
else if(istype(W, /obj/item/weapon/crowbar))
if(loaded_tank && !locked)
if(loaded_tank)
if(locked)
to_chat(user, "<span class='warning'>The controls are locked!</span>")
return TRUE
eject()
return 1
return TRUE
else
to_chat(user, "<span class='warning'>There isn't a tank loaded!</span>")
return TRUE
else if(istype(W, /obj/item/weapon/wrench))
default_unfasten_wrench(user, W, 0)
return 1
return TRUE
else if(W.GetID())
if(allowed(user))
if(active)
Expand All @@ -104,7 +112,7 @@ GLOBAL_LIST_EMPTY(rad_collectors)
to_chat(user, "<span class='warning'>The controls can only be locked when \the [src] is active!</span>")
else
to_chat(user, "<span class='danger'>Access denied.</span>")
return 1
return TRUE
else
return ..()

Expand Down

0 comments on commit 5cc9387

Please sign in to comment.