Skip to content

Commit

Permalink
add: ASHIE UPDATE (#5875)
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoonij authored Nov 4, 2024
1 parent 1036de4 commit e1ef02c
Show file tree
Hide file tree
Showing 18 changed files with 1,574 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,14 @@
},
/turf/simulated/mineral/volcanic/lava_land_surface,
/area/lavaland/surface/outdoors)
"qj" = (
/obj/structure/stone_tile/cracked{
dir = 4
},
/obj/effect/mapping_helpers/no_lava,
/obj/effect/decal/cleanable/ashrune,
/turf/simulated/floor/plating/asteroid/basalt/lava_land_surface,
/area/lavaland/surface/outdoors)
"zz" = (
/obj/effect/mapping_helpers/no_lava,
/obj/structure/stone_tile{
Expand Down Expand Up @@ -1606,7 +1614,7 @@ ak
ak
cg
cb
cg
qj
cn
bL
dr
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@
#define isskeleton(A) (is_species(A, /datum/species/skeleton))
#define ishumanbasic(A) (is_species(A, /datum/species/human))
#define isunathi(A) (is_species(A, /datum/species/unathi))
#define isashwalker(A) (is_species(A, /datum/species/unathi/ashwalker))
#define isashwalkershaman(A) (is_species(A, /datum/species/unathi/ashwalker/shaman))
#define istajaran(A) (is_species(A, /datum/species/tajaran))
#define isvulpkanin(A) (is_species(A, /datum/species/vulpkanin))
#define isskrell(A) (is_species(A, /datum/species/skrell))
Expand Down
18 changes: 18 additions & 0 deletions code/__DEFINES/rituals.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// Used in ritual variables
#define DEFAULT_RITUAL_RANGE_FIND 1
#define DEFAULT_RITUAL_COOLDOWN (100 SECONDS)
#define DEFAULT_RITUAL_DISASTER_PROB 10
#define DEFAULT_RITUAL_FAIL_PROB 10
/// Ritual object bitflags
#define RITUAL_STARTED (1<<0)
#define RITUAL_ENDED (1<<1)
#define RITUAL_FAILED (1<<2)
/// Ritual datum bitflags
#define RITUAL_SUCCESSFUL (1<<0)
/// Invocation checks, should not be used in extra checks.
#define RITUAL_FAILED_INVALID_SPECIES (1<<1)
#define RITUAL_FAILED_EXTRA_INVOKERS (1<<2)
#define RITUAL_FAILED_MISSED_REQUIREMENTS (1<<3)
#define RITUAL_FAILED_ON_PROCEED (1<<4)
#define RITUAL_FAILED_INVALID_SPECIAL_ROLE (1<<5)

2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@

#define STATUS_EFFECT_CRUSHERMARK /datum/status_effect/crusher_mark //if struck with a proto-kinetic crusher, takes a ton of damage

#define STATUS_EFFECT_FANG_EXHAUSTION /datum/status_effect/fang_exhaust // called by poison fang (crusher trophy)

#define STATUS_EFFECT_SAWBLEED /datum/status_effect/saw_bleed //if the bleed builds up enough, takes a ton of damage

#define STATUS_EFFECT_BLOODLETTING /datum/status_effect/saw_bleed/bloodletting //nerfed version
Expand Down
2 changes: 2 additions & 0 deletions code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@
prize_list["Miscellaneous"] = list(
EQUIPMENT("Absinthe", /obj/item/reagent_containers/food/drinks/bottle/absinthe/premium, 500),
EQUIPMENT("Alien Toy", /obj/item/clothing/mask/facehugger/toy, 300),
EQUIPMENT("Richard & Co cigarettes", /obj/item/storage/fancy/cigarettes/cigpack_richard, 400),
EQUIPMENT("Cigar", /obj/item/clothing/mask/cigarette/cigar/havana, 300),
EQUIPMENT("GAR Meson Scanners", /obj/item/clothing/glasses/meson/gar, 800),
EQUIPMENT("GPS upgrade", /obj/item/gpsupgrade, 1500),
Expand Down Expand Up @@ -342,6 +343,7 @@
EQUIPMENT("Absinthe", /obj/item/reagent_containers/food/drinks/bottle/absinthe/premium, 250),
EQUIPMENT("Cigarettes", /obj/item/storage/fancy/cigarettes, 100),
EQUIPMENT("Medical Marijuana", /obj/item/storage/fancy/cigarettes/cigpack_med, 250),
EQUIPMENT("Richard & Co cigarettes", /obj/item/storage/fancy/cigarettes/cigpack_richard, 400),
EQUIPMENT("Cigar", /obj/item/clothing/mask/cigarette/cigar/havana, 150),
EQUIPMENT("Box of matches", /obj/item/storage/box/matches, 50),
EQUIPMENT("Cheeseburger", /obj/item/reagent_containers/food/snacks/cheeseburger, 150),
Expand Down
119 changes: 119 additions & 0 deletions code/datums/components/ritual_object.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/datum/component/ritual_object
/// Pre-defined rituals list
var/list/rituals = list()
/// We define rituals from this.
var/list/allowed_categories
/// Required species to activate ritual object
var/list/allowed_species
/// Required special role to activate ritual object
var/list/allowed_special_role
/// Prevents from multiple uses
var/active_ui = FALSE

/datum/component/ritual_object/Initialize(
allowed_categories = /datum/ritual,
list/allowed_species,
list/allowed_special_role
)

if(!isobj(parent))
return COMPONENT_INCOMPATIBLE

src.allowed_categories = allowed_categories
src.allowed_species = allowed_species
src.allowed_special_role = allowed_special_role
get_rituals()

/datum/component/ritual_object/RegisterWithParent()
RegisterSignal(parent, COMSIG_ATOM_ATTACK_HAND, PROC_REF(attackby))

/datum/component/ritual_object/UnregisterFromParent()
UnregisterSignal(parent, COMSIG_ATOM_ATTACK_HAND)

/datum/component/ritual_object/proc/get_rituals() // We'll get all rituals for flexibility.
LAZYCLEARLIST(rituals)

for(var/datum/ritual/ritual as anything in typecacheof(allowed_categories))
if(!ritual.name)
continue

rituals += new ritual

for(var/datum/ritual/ritual as anything in rituals)
ritual.ritual_object = parent

return

/datum/component/ritual_object/Destroy(force)
LAZYNULL(rituals)
return ..()

/datum/component/ritual_object/proc/attackby(datum/source, mob/user)
SIGNAL_HANDLER

if(active_ui)
return

if(!ishuman(user))
return

var/mob/living/carbon/human/human = user

if(allowed_species && !is_type_in_list(human.dna.species, allowed_species))
return

if(allowed_special_role && !is_type_in_list(human.mind?.special_role, allowed_special_role))
return

active_ui = TRUE
INVOKE_ASYNC(src, PROC_REF(open_ritual_ui), human)

return COMPONENT_CANCEL_ATTACK_CHAIN

/datum/component/ritual_object/proc/open_ritual_ui(mob/living/carbon/human/human)
var/list/rituals_list = get_available_rituals(human)

if(!LAZYLEN(rituals_list))
active_ui = FALSE
to_chat(human, "Не имеется доступных для выполнения ритуалов.")
return

var/choosen_ritual = tgui_input_list(human, "Выберите ритуал", "Ритуалы", rituals_list)

if(!choosen_ritual)
active_ui = FALSE
return

var/ritual_status

for(var/datum/ritual/ritual as anything in rituals)
if(choosen_ritual != ritual.name)
continue

ritual_status = ritual.pre_ritual_check(human)
break

if(ritual_status)
active_ui = FALSE

return FALSE

/datum/component/ritual_object/proc/get_available_rituals(mob/living/carbon/human/human)
var/list/rituals_list = list()

for(var/datum/ritual/ritual as anything in rituals)
if(ritual.charges == 0)
continue

if(!COOLDOWN_FINISHED(ritual, ritual_cooldown))
continue

if(ritual.allowed_species && !is_type_in_list(human.dna.species, ritual.allowed_species))
continue

if(ritual.allowed_special_role && !is_type_in_list(human.mind?.special_role, ritual.allowed_special_role))
continue

LAZYADD(rituals_list, ritual.name)

return rituals_list
Loading

0 comments on commit e1ef02c

Please sign in to comment.