mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Added flags for Mining and Xenoarch.
This commit is contained in:
@@ -181,3 +181,70 @@
|
||||
icon_opened = "miningcaropen"
|
||||
icon_closed = "miningcar"
|
||||
|
||||
// Flags.
|
||||
|
||||
/obj/item/stack/flag
|
||||
name = "flags"
|
||||
desc = "Some colourful flags."
|
||||
singular_name = "flag"
|
||||
amount = 10
|
||||
max_amount = 10
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
var/upright = 0
|
||||
var/base_state
|
||||
|
||||
/obj/item/stack/flag/New()
|
||||
..()
|
||||
base_state = icon_state
|
||||
|
||||
/obj/item/stack/flag/red
|
||||
name = "red flags"
|
||||
singular_name = "red flag"
|
||||
icon_state = "redflag"
|
||||
|
||||
/obj/item/stack/flag/yellow
|
||||
name = "yellow flags"
|
||||
singular_name = "yellow flag"
|
||||
icon_state = "yellowflag"
|
||||
|
||||
/obj/item/stack/flag/green
|
||||
name = "green flags"
|
||||
singular_name = "green flag"
|
||||
icon_state = "greenflag"
|
||||
|
||||
/obj/item/stack/flag/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(upright && istype(W,src.type))
|
||||
src.attack_hand(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/stack/flag/attack_hand(user as mob)
|
||||
if(upright)
|
||||
upright = 0
|
||||
icon_state = base_state
|
||||
anchored = 0
|
||||
src.visible_message("<b>[user]</b> knocks down [src].")
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/stack/flag/attack_self(mob/user as mob)
|
||||
|
||||
var/obj/item/stack/flag/F = locate() in get_turf(src)
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T || !istype(T,/turf/simulated/floor/plating/airless/asteroid))
|
||||
user << "The flag won't stand up in this terrain."
|
||||
return
|
||||
|
||||
if(F && F.upright)
|
||||
user << "There is already a flag here."
|
||||
return
|
||||
|
||||
var/obj/item/stack/flag/newflag = new src.type(T)
|
||||
newflag.amount = 1
|
||||
newflag.upright = 1
|
||||
anchored = 1
|
||||
newflag.name = newflag.singular_name
|
||||
newflag.icon_state = "[newflag.base_state]_open"
|
||||
newflag.visible_message("<b>[user]</b> plants [newflag] firmly in the ground.")
|
||||
src.use(1)
|
||||
|
||||
Reference in New Issue
Block a user