Skip to content

Commit

Permalink
Якорь (BlueMoon-Labs#640)
Browse files Browse the repository at this point in the history
* имплант якорь

* имплант якорь

* хотфикс имплантирования якорем

* якорь

иконка на сб худы, изменяемый массив секторов с рефом на гейм мод

* якорь

---------

Co-authored-by: Марк <[email protected]>
  • Loading branch information
FinkRLD and SmiLeYre authored Dec 15, 2023
1 parent 541567b commit 749d961
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 19 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
#define TRAIT_NOHARDCRIT "nohardcrit"
#define TRAIT_NOSOFTCRIT "nosoftcrit"
#define TRAIT_MINDSHIELD "mindshield"
#define TRAIT_ANCHOR "anchor"
#define TRAIT_HIJACKER "hijacker"
#define TRAIT_SIXTHSENSE "sixthsense"
#define TRAIT_DISSECTED "dissected"
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NOHARDCRIT" = TRAIT_NOHARDCRIT,
"TRAIT_NOSOFTCRIT" = TRAIT_NOSOFTCRIT,
"TRAIT_MINDSHIELD" = TRAIT_MINDSHIELD,
"TRAIT_ANCHOR" = TRAIT_ANCHOR,
"TRAIT_HIJACKER" = TRAIT_HIJACKER,
"TRAIT_DISSECTED" = TRAIT_DISSECTED,
"TRAIT_SIXTHSENSE" = TRAIT_SIXTHSENSE,
Expand Down
5 changes: 5 additions & 0 deletions code/_rendering/atom_huds/data_huds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@
var/icon/IC = icon(icon, icon_state, dir)
holder.pixel_y = IC.Height() - world.icon_size
holder.icon_state = "hud_imp_loyal"
if(HAS_TRAIT(src, TRAIT_ANCHOR))
holder = hud_list[IMPLOYAL_HUD]
var/icon/IC = icon(icon, icon_state, dir)
holder.pixel_y = IC.Height() - world.icon_size
holder.icon_state = "hud_imp_anchor"

/mob/living/carbon/human/proc/sec_hud_set_security_status()
var/image/holder = hud_list[WANTED_HUD]
Expand Down
Binary file modified icons/mob/hud.dmi
Binary file not shown.
39 changes: 20 additions & 19 deletions modular_bluemoon/Fink/code/items/implant_anchor.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/obj/item/implant/anchor
name = "anchor implant"
desc = "Prevents you from leaving local sector, guarded by you."
var/base_z_level
var/list/allowed_z_levels

/obj/item/implant/anchor/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
Expand All @@ -19,26 +19,27 @@
imp_type = /obj/item/implant/anchor

/obj/item/implant/anchor/Initialize()
. = ..()
var/base_z_level = imp_in.z
return base_z_level

//шаблон имплантации раундстартом, вставить в желаемую гостроль
//var/mob/living/M = mob_override || owner.current
//M.faction |= ROLE_???
//var/obj/item/implant/anchor/Implant = new/obj/item/implant/anchor(M)
.=..()
allowed_z_levels = list(1,12,imp_in.z) // dynamic набор: цк, межшатолье, инфдормы, сектор имплантации
if(GLOB.master_mode == "Extended")
allowed_z_levels.Add(2,5,6) // экстовая добавка: станционный, шахта, ксено
return allowed_z_levels

/obj/item/implant/anchor/implant(mob/living/target, mob/user, silent, force)
. = ..()

RegisterSignal(target, COMSIG_LIVING_LIFE, .proc/on_life)
var/base_z_level = target.z

return base_z_level

/obj/item/implant/anchor/proc/on_life(mob/living/owner, base_z_level)
if((owner.z != base_z_level) && (owner.z != 1)) // не сектор спавна и не сектор цк?
to_chat(owner, "<span class='rose'>It hurts!</span>")
RegisterSignal(imp_in, COMSIG_LIVING_LIFE, .proc/on_life)
ADD_TRAIT(target, TRAIT_ANCHOR, "implant")
target.sec_hud_set_implants()
return TRUE


/obj/item/implant/anchor/proc/on_life(mob/living/owner)
if(!(allowed_z_levels))
allowed_z_levels = Initialize()
// to_chat(owner, "<span class='rose'>allowed_z_levels [allowed_z_levels], owner.z [owner.z] </span>")
// to_chat(owner, "<span class='rose'>Tick</span>")
if(!(owner.z in allowed_z_levels))
to_chat(owner, "<span class='warning'>It hurts!</span>")
owner.adjustBruteLoss(0.5, FALSE) //Provides slow harassing for both brute and burn damage.
owner.adjustFireLoss(0.5, FALSE)
to_chat(owner, "<span class='rose'>I don`t feeling well leaving my local sector.</span>")
to_chat(owner, "<span class='warning'>I don`t feeling well leaving my local sector.</span>")

0 comments on commit 749d961

Please sign in to comment.