Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 8b682ef

Browse files
committed
Actually make it do something
1 parent 8c907d8 commit 8b682ef

File tree

2 files changed

+48
-7
lines changed

2 files changed

+48
-7
lines changed

code/modules/clothing/chameleon.dm

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,26 +142,68 @@
142142
qdel(O)
143143
return TRUE
144144

145-
/datum/action/chameleon_copy
145+
/datum/action/cooldown/chameleon_copy
146146
name = "Copy person"
147147
button_icon_state = "default" //Temporary, just to test it works
148+
var/target_range = 3
148149
var/syndicate = FALSE
149150
var/active = FALSE
150151
var/copying = FALSE
152+
var/in_use = FALSE
151153

152-
/datum/action/chameleon_copy/Grant(mob/M)
154+
/datum/action/cooldown/chameleon_copy/Grant(mob/M)
153155
if(syndicate)
154156
owner_has_control = is_syndicate(M)
155157
return ..()
156158

157-
/datum/action/chameleon_copy/Trigger(trigger_flags, atom/target)
159+
/datum/action/cooldown/chameleon_copy/Trigger(trigger_flags, atom/target)
158160
if(active)
159-
active = !active
161+
active = FALSE
160162
build_all_button_icons()
161163
return FALSE
162164
to_chat(owner, span_announce("Whom shall your chameleon kit copy?")) //Bad wording, need to improve it
163-
active = !active
165+
active = TRUE
164166
build_all_button_icons()
167+
if(target)
168+
return InterceptClickOn(owner, null, target)
169+
170+
/datum/action/cooldown/chameleon_copy/proc/CheckValidTarget(atom/target_atom)
171+
if(target_atom == owner)
172+
return FALSE
173+
return TRUE
174+
175+
/datum/action/cooldown/chameleon_copy/proc/CheckCanTarget(atom/target_atom)
176+
if(target_range)
177+
if(!(target_atom in view(target_range, owner)))
178+
return FALSE
179+
return istype(target_atom)
180+
181+
/datum/action/cooldown/chameleon_copy/proc/click_with_power(atom/target_atom)
182+
if(in_use || !CheckValidTarget(target_atom))
183+
return FALSE
184+
if(!CheckCanTarget(target_atom))
185+
return TRUE
186+
in_use = TRUE
187+
FireTargetedPower(target_atom)
188+
in_use = FALSE
189+
return TRUE
190+
191+
/datum/action/cooldown/chameleon_copy/proc/FireTargetedPower(atom/target_atom)
192+
. = ..()
193+
var/mob/living/target = target_atom
194+
var/mob/living/user = owner
195+
var/datum/outfit/O = new()
196+
to_chat(owner, span_notice("Attempting to copy [target]..."))
197+
if(!do_after(user, 5 SECONDS, target))
198+
return
199+
for(var/item in target.contents)
200+
message_admins(item)
201+
to_chat(owner, span_notice("Successfully copied [target]!"))
202+
active = FALSE
203+
204+
205+
/datum/action/cooldown/chameleon_copy/InterceptClickOn(/mob/living/caller, params, atom/target)
206+
click_with_power()
165207

166208
/datum/action/item_action/chameleon/change
167209
name = "Chameleon Change"
@@ -180,7 +222,7 @@
180222
var/datum/action/chameleon_outfit/O = new /datum/action/chameleon_outfit()
181223
O.syndicate = syndicate
182224
O.Grant(M)
183-
var/datum/action/chameleon_copy/C = new /datum/action/chameleon_copy()
225+
var/datum/action/cooldown/chameleon_copy/C = new /datum/action/cooldown/chameleon_copy()
184226
C.syndicate = syndicate
185227
C.Grant(M)
186228
else

yogstation/code/game/objects/items/implants/implant_infiltrator.dm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
else
8282
pinpointer.scan_target = targets[pinpointer_chosen]
8383
to_chat(imp_in, span_notice("Pinpointer target set to [pinpointer.scan_target]"))
84-
message_admins(pinpointer.scan_target)
8584
pinpointer.point_to_target()
8685
if ("Send Ship Away")
8786
alert_radio.talk_into(alert_radio, "The infiltration cruiser has been remotely sent to the base by [imp_in.real_name]")

0 commit comments

Comments
 (0)