Skip to content

Commit

Permalink
правки
Browse files Browse the repository at this point in the history
  • Loading branch information
Anorak2024 committed Oct 31, 2024
1 parent 0930efb commit 0b1cef0
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 103 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@
#define isdemon(A) (istype((A), /mob/living/simple_animal/demon))
#define ismorph(A) (istype((A), /mob/living/simple_animal/hostile/morph))
#define isborer(A) (istype((A), /mob/living/simple_animal/borer))
#define isrevenant(A) (istype((A), /mob/living/simple_animal/revenant))
#define isshadowdemon(A) (istype((A), /mob/living/simple_animal/demon/shadow))

#define issilicon(A) (istype((A), /mob/living/silicon))
#define isAI(A) (istype((A), /mob/living/silicon/ai))
Expand Down
44 changes: 44 additions & 0 deletions code/datums/components/spy_bug.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/datum/component/spy_bug
var/obj/item/spy_bug/bug

/datum/component/spy_bug/RegisterWithParent()
var/atom/par = parent
for (var/obj/item/spy_bug/spy_bug in par.contents)
bug = spy_bug

RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine))
RegisterSignal(parent, COMSIG_CLICK_ALT, PROC_REF(on_altclick))
RegisterSignal(parent, COMSIG_PREQDELETED, PROC_REF(deleted_handler))

/datum/component/spy_bug/UnregisterFromParent()
UnregisterSignal(parent, COMSIG_PARENT_EXAMINE)
UnregisterSignal(parent, COMSIG_CLICK_ALT)
UnregisterSignal(parent, COMSIG_PREQDELETED)

/datum/component/spy_bug/proc/on_examine(datum/source, mob/living/carbon/human/user, list/examine_list)
SIGNAL_HANDLER

if(!istype(user))
return

examine_list += span_warning("Вы видите небольшое устройство с микрофоном и камерой.")

/datum/component/spy_bug/proc/on_altclick(datum/source, mob/living/carbon/human/user)
SIGNAL_HANDLER

if(!istype(user))
return

if(!user.Adjacent(parent))
return

if(user.stat)
return

if(HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
return

bug.unhook(user)

/datum/component/spy_bug/proc/deleted_handler()
bug.unhook()
2 changes: 1 addition & 1 deletion code/datums/spells/bloodcrawl.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@

/obj/effect/proc_holder/spell/bloodcrawl/shadow_crawl/post_phase_in(mob/living/user, obj/effect/dummy/slaughter/holder)
..()
if(!istype(user, /mob/living/simple_animal/demon/shadow))
if(!isshadowdemon(user))
return
var/mob/living/simple_animal/demon/shadow/demon = user
demon.RegisterSignal(holder, COMSIG_MOVABLE_MOVED, TYPE_PROC_REF(/mob/living/simple_animal/demon/shadow, check_darkness))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
/datum/objective/wrap/check_completion()
var/wrap_count = 0
for(var/datum/mind/player in get_owners())
if(!istype(player.current, /mob/living/simple_animal/demon/shadow) || QDELETED(player.current))
if(!isshadowdemon(player.current) || QDELETED(player.current))
continue

var/mob/living/simple_animal/demon/shadow/demon = player.current
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/miniantags/revenant/revenant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@

for(var/mob/M in GLOB.mob_list)
var/rendered = "<span class='revennotice'><b>[src]</b> [(isobserver(M) ? ("([ghost_follow_link(src, ghost=M)])") : "")] says, \"[message]\"</span>"
if(istype(M, /mob/living/simple_animal/revenant) || isobserver(M))
if(isrevenant(M) || isobserver(M))
to_chat(M, rendered)


Expand Down Expand Up @@ -355,7 +355,7 @@
var/total_essence = 0

for(var/datum/mind/player in get_owners())
if(!istype(player.current, /mob/living/simple_animal/revenant) || QDELETED(player.current))
if(!isrevenant(player.current) || QDELETED(player.current))
continue

var/mob/living/simple_animal/revenant/revenant = player.current
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/items/devices/uplinks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,10 @@ GLOBAL_LIST_EMPTY(world_uplinks)
malfs += ismalfAI(M)
borers += isborer(M)
morphs += ismorph(M)
revenants += istype(M, /mob/living/simple_animal/revenant)
revenants += isrevenant(M)
demons += isdemon(M)
shadow_demons += istype(M, /mob/living/simple_animal/demon/shadow)
pulse_demons += istype(M, /mob/living/simple_animal/demon/pulse_demon)
shadow_demons += isshadowdemon(M)
pulse_demons += ispulsedemon(M)

crew += ishuman(M)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,57 +18,30 @@

changing = TRUE

var/list/choices // only types that we can meet in the game

if(!stud)
choices = list(
"iron" = image(icon = 'icons/obj/clothing/rings.dmi', icon_state = "ironring"),
"silver" = image(icon = 'icons/obj/clothing/rings.dmi', icon_state = "silverring"),
"gold" = image(icon = 'icons/obj/clothing/rings.dmi', icon_state = "goldring"),
"plasma" = image(icon = 'icons/obj/clothing/rings.dmi', icon_state = "plasmaring"),
"uranium" = image(icon = 'icons/obj/clothing/rings.dmi', icon_state = "uraniumring")
)
else
choices = list(
"iron" = image(icon = 'icons/obj/clothing/rings.dmi', icon_state = "d_ironring"),
"silver" = image(icon = 'icons/obj/clothing/rings.dmi', icon_state = "d_silverring"),
"gold" = image(icon = 'icons/obj/clothing/rings.dmi', icon_state = "d_goldring"),
"plasma" = image(icon = 'icons/obj/clothing/rings.dmi', icon_state = "d_plasmaring"),
"uranium" = image(icon = 'icons/obj/clothing/rings.dmi', icon_state = "d_uraniumring")
)

var/selected_chameleon = show_radial_menu(usr, loc, choices, require_near = TRUE)
switch(selected_chameleon)
if("iron")
name = "iron ring"
icon_state = "ironring"
material = "iron"
ring_color = "iron"
if("silver")
name = "silver ring"
icon_state = "silverring"
material = "silver"
ring_color = "silver"
if("gold")
name = "gold ring"
icon_state = "goldring"
material = "gold"
ring_color = "gold"
if("plasma")
name = "plasma ring"
icon_state = "plasmaring"
material = "plasma"
ring_color = "plasma"
if("uranium")
name = "uranium ring"
icon_state = "uraniumring"
material = "uranium"
ring_color = "uranium"
else
changing = FALSE
return

user.visible_message(span_warning("[user] changes the look of his ring!"), span_notice("[selected_chameleon] selected."))
// only types that we can meet in the game
var/list/possible = list("iron ring", "silver ring", "gold ring", "plasma ring", "uranium ring")
var/list/obj/item/clothing/gloves/ring/choices = list()
for(var/type in typesof(/obj/item/clothing/gloves/ring))
if(type == src.type)
continue

if(!(name in possible))
continue

var/obj/item/clothing/gloves/ring/ring = new type
ring.stud = stud
choices[ring] = image(icon = ring.icon, icon_state = ring.icon_state)

var/obj/item/clothing/gloves/ring/selected_chameleon = show_radial_menu(usr, loc, choices, require_near = TRUE)
if(!selected_chameleon)
return

name = selected_chameleon.name
icon_state = selected_chameleon.icon_state
material = selected_chameleon.material
ring_color = selected_chameleon.ring_color

user.visible_message(span_warning("[user] изменяет внешний вид кольца!"), span_notice("[selected_chameleon] selected."))
playsound(loc, 'sound/items/screwdriver2.ogg', 50, 1)
to_chat(user, span_notice("Смена маскировки..."))
update_icon(UPDATE_ICON_STATE)
Expand Down
44 changes: 0 additions & 44 deletions code/modules/antagonists/traitor/affiliates/items/mi13/spy_kit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,50 +86,6 @@
c_tag = new_name
camera = new(src, network, c_tag)

/datum/component/spy_bug
var/obj/item/spy_bug/bug

/datum/component/spy_bug/RegisterWithParent()
var/atom/par = parent
for (var/obj/item/spy_bug/spy_bug in par.contents)
bug = spy_bug

RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine))
RegisterSignal(parent, COMSIG_CLICK_ALT, PROC_REF(on_altclick))
RegisterSignal(parent, COMSIG_PREQDELETED, PROC_REF(deleted_handler))

/datum/component/spy_bug/UnregisterFromParent()
UnregisterSignal(parent, COMSIG_PARENT_EXAMINE)
UnregisterSignal(parent, COMSIG_CLICK_ALT)
UnregisterSignal(parent, COMSIG_PREQDELETED)

/datum/component/spy_bug/proc/on_examine(datum/source, mob/living/carbon/human/user, list/examine_list)
SIGNAL_HANDLER

if(!istype(user))
return

examine_list += span_warning("Вы видите небольшое устройство с микрофоном и камерой.")

/datum/component/spy_bug/proc/on_altclick(datum/source, mob/living/carbon/human/user)
SIGNAL_HANDLER

if(!istype(user))
return

if(!user.Adjacent(parent))
return

if(user.stat)
return

if(HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
return

bug.unhook(user)

/datum/component/spy_bug/proc/deleted_handler()
bug.unhook()

/obj/item/camera_bug/spy_monitor
name = "spy monitor"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/holder_pet_carrier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
if(target.mob_size > mob_size)
to_chat(user, span_warning("Ваша переноска слишком мала!"))
return FALSE
if(istype(target, /mob/living/simple_animal/revenant))
if(!isrevenant(target))
return FALSE

target.forceMove(src)
Expand Down
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@
#include "code\datums\components\slippery.dm"
#include "code\datums\components\spawner.dm"
#include "code\datums\components\spooky.dm"
#include "code\datums\components\spy_bug.dm"
#include "code\datums\components\squeak.dm"
#include "code\datums\components\surgery_initiator.dm"
#include "code\datums\components\swarming.dm"
Expand Down

0 comments on commit 0b1cef0

Please sign in to comment.