|
157 | 157 | return ..() |
158 | 158 |
|
159 | 159 | /datum/action/cooldown/chameleon_copy/Trigger(trigger_flags, mob/living/copy_target) |
| 160 | + message_admins("Trigger called") |
| 161 | + message_admins("Trigger: [copy_target]") |
160 | 162 | if(active) |
161 | 163 | active = FALSE |
162 | 164 | background_icon_state = "bg_default" |
|
172 | 174 | return set_click_ability(owner) |
173 | 175 |
|
174 | 176 | /datum/action/cooldown/chameleon_copy/proc/CheckValidTarget(mob/living/copy_target) |
| 177 | + message_admins("CheckValidTarget called") |
175 | 178 | if(copy_target == owner) |
176 | 179 | return FALSE |
177 | 180 | return TRUE |
178 | 181 |
|
179 | | -/datum/action/cooldown/chameleon_copy/proc/CheckCanTarget(mob/living/copy_target) |
180 | | - var/mob/living/carbon/human/user = owner |
181 | | - if(target_range) |
182 | | - if(!(get_dist(user, copy_target) <= target_range)) //get_dist really hates datums for some reason |
183 | | - return FALSE |
184 | | - return istype(target) |
| 182 | +/datum/action/cooldown/chameleon_copy/proc/CheckCanTarget(atom/target) |
| 183 | + return !isnull(target) |
185 | 184 |
|
186 | | -/datum/action/cooldown/chameleon_copy/proc/click_with_power(mob/living/copy_target) |
187 | | - if(in_use || !CheckValidTarget(copy_target)) |
| 185 | +/datum/action/cooldown/chameleon_copy/proc/click_with_power(atom/target) |
| 186 | + message_admins("click_with_power called") |
| 187 | + message_admins("Click: [target]") |
| 188 | + if(in_use || !CheckValidTarget(target)) |
| 189 | + message_admins("Failed click_with_power 1") |
188 | 190 | return FALSE |
189 | | - if(!CheckCanTarget(copy_target)) |
| 191 | + if(!CheckCanTarget(target)) |
| 192 | + message_admins("Failed click_with_power 2") |
190 | 193 | return TRUE |
191 | 194 | in_use = TRUE |
192 | | - FireTargetedPower(copy_target) |
| 195 | + FireTargetedPower(target) |
193 | 196 | in_use = FALSE |
194 | 197 | return TRUE |
195 | 198 |
|
196 | | -/datum/action/cooldown/chameleon_copy/proc/FireTargetedPower(mob/living/copy_target) |
| 199 | +/datum/action/cooldown/chameleon_copy/proc/FireTargetedPower(atom/target) |
| 200 | + message_admins("FireTargetedPower called") |
| 201 | + var/mob/M = target |
| 202 | + message_admins("Mob: [M]") |
197 | 203 | //var/datum/outfit/O = new() |
198 | | - to_chat(owner, span_notice("Attempting to copy [copy_target]...")) |
199 | | - if(!do_after(owner, 5 SECONDS, copy_target)) |
| 204 | + to_chat(owner, span_notice("Attempting to copy [M]...")) |
| 205 | + if(!do_after(owner, 5 SECONDS, target)) |
200 | 206 | return |
201 | | - for(var/item in copy_target.contents) |
| 207 | + for(var/item in target.contents) |
202 | 208 | message_admins(item) |
203 | | - to_chat(owner, span_notice("Successfully copied [copy_target]!")) |
| 209 | + to_chat(owner, span_notice("Successfully copied [M]!")) |
204 | 210 | active = FALSE |
205 | 211 |
|
206 | 212 |
|
207 | 213 | /datum/action/cooldown/chameleon_copy/InterceptClickOn(/mob/living/caller, params, atom/target) |
208 | | - var/mob/living/copy_target = target |
209 | | - click_with_power(copy_target) |
| 214 | + message_admins("InterceptClickOn called") |
| 215 | + message_admins("Intercept: [target]") |
| 216 | + click_with_power(target) |
210 | 217 |
|
211 | 218 | /datum/action/item_action/chameleon/change |
212 | 219 | name = "Chameleon Change" |
|
0 commit comments