Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Раундстарт Ивенты имени Киборга04 (РИК04) ® © #7154

Merged
merged 35 commits into from May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
18f5db1
Основа для будущего контента готова
KIBORG04 May 9, 2021
86a83b8
Замена названия переменной
KIBORG04 May 9, 2021
e9a98f4
Добавлен контент
KIBORG04 May 10, 2021
135ff0f
Еще больше контента
KIBORG04 May 11, 2021
6927375
Фиксы контента
KIBORG04 May 11, 2021
b0f9190
Merge branch 'master' of https://github.com/TauCetiStation/TauCetiCla…
KIBORG04 May 11, 2021
5a85711
корректировки названий
KIBORG04 May 11, 2021
5156218
ой-йо
KIBORG04 May 12, 2021
fbaced4
Синди боксы и сломанный емаг
KIBORG04 May 12, 2021
f811700
Ревью + фикс датума ивентов у мехов
KIBORG04 May 12, 2021
8a36971
Повысил шанс метахуйне
KIBORG04 May 12, 2021
a946594
Теперь может быть 1-3 рандомных ивента, но при этом немного повысил ш…
KIBORG04 May 12, 2021
b2479f5
Теперь раундстарт ивенты не попадут в ивенты другой опасности
KIBORG04 May 14, 2021
cf3c1b8
мыши научились грызть провода
KIBORG04 May 14, 2021
5b4041a
Микрофиксы
KIBORG04 May 16, 2021
195d241
Merge branch 'master' into round_start_events
KIBORG04 May 16, 2021
f879128
тернарка так тернарка
KIBORG04 May 17, 2021
69bafd3
Переименовал файл
KIBORG04 May 17, 2021
37d86cf
бухгалтерия что-то напутала и пупа получил зарплату.......
KIBORG04 May 17, 2021
8689182
опять файл переименовал
KIBORG04 May 17, 2021
1cf3335
Клоун шутка арилок хаха
KIBORG04 May 17, 2021
0c1988b
Еще ивентики
KIBORG04 May 17, 2021
5eeb423
оу щит, забыл два ивента прописать
KIBORG04 May 17, 2021
2726b4c
Два новых ивента
KIBORG04 May 18, 2021
a089ca2
ладно
KIBORG04 May 18, 2021
97bab37
Merge branch 'master' of https://github.com/TauCetiStation/TauCetiCla…
KIBORG04 May 18, 2021
483a2c7
еще ивент с минами
KIBORG04 May 18, 2021
573590b
Update code/modules/events/roundstart_events/misc_events.dm
KIBORG04 May 20, 2021
964d9b7
Update code/modules/events/roundstart_events/misc_events.dm
KIBORG04 May 20, 2021
ef7ea53
Удалил фулл акцесс, ям-батоны, форсмувыыы
KIBORG04 May 20, 2021
b1d049a
Merge branch 'round_start_events' of https://github.com/KIBORG04/TauB…
KIBORG04 May 20, 2021
714c0ae
Я зачем-то делал лист в листе
KIBORG04 May 20, 2021
c441a7d
...
KIBORG04 May 20, 2021
d6681e5
Merge branch 'master' into round_start_events
KIBORG04 May 27, 2021
0710a25
Merge branch 'master' into round_start_events
KIBORG04 May 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 16 additions & 3 deletions code/__DEFINES/misc.dm
Expand Up @@ -84,9 +84,10 @@
#define shuttle_time_in_station 1800 // 3 minutes in the station
#define shuttle_time_to_arrive 6000 // 10 minutes to arrive

#define EVENT_LEVEL_MUNDANE 1
#define EVENT_LEVEL_MODERATE 2
#define EVENT_LEVEL_MAJOR 3
#define EVENT_LEVEL_ROUNDSTART 1
#define EVENT_LEVEL_MUNDANE 2
#define EVENT_LEVEL_MODERATE 3
#define EVENT_LEVEL_MAJOR 4

//defines
#define RESIZE_DEFAULT_SIZE 1
Expand Down Expand Up @@ -183,6 +184,8 @@

#define COORD(A) "([A.x],[A.y],[A.z])"

#define RUNE_WORDS list("travel", "blood", "join", "hell", "destroy", "technology", "self", "see", "other", "hide")

//Error handler defines
#define ERROR_USEFUL_LEN 2

Expand Down Expand Up @@ -216,6 +219,16 @@

#define PLASMAGUN_OVERCHARGE 30100

#define VAR_SWAP(A, B)\
var/temp = A;\
A = B;\
B = temp;\

#define LOC_SWAP(A, B)\
var/atom/temp = A.loc;\
A.forceMove(B.loc);\
B.forceMove(temp);\

//! ## Overlays subsystem

///Compile all the overlays for an atom from the cache lists
Expand Down
55 changes: 43 additions & 12 deletions code/__HELPERS/unsorted.dm
Expand Up @@ -202,7 +202,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
break

//update our pda and id if we have them on our person
var/list/searching = GetAllContents(searchDepth = 3)
var/list/searching = GetAllContents()
var/search_id = 1
var/search_pda = 1

Expand Down Expand Up @@ -569,16 +569,43 @@ Turf and target are seperate in case you want to teleport some distance from a t
sleep(max(sleeptime, 15))
qdel(animation)

//Will return the contents of an atom recursivly to a depth of 'searchDepth'
/atom/proc/GetAllContents(searchDepth = 5)
LudwigVonChesterfield marked this conversation as resolved.
Show resolved Hide resolved
var/list/toReturn = list()

for(var/atom/part in contents)
toReturn += part
if(part.contents.len && searchDepth)
toReturn += part.GetAllContents(searchDepth - 1)

return toReturn
///Returns the src and all recursive contents as a list.
/atom/proc/GetAllContents()
. = list(src)
var/i = 0
while(i < length(.))
var/atom/A = .[++i]
. += A.contents

/atom/proc/GetAreaAllContents()
. = list(src)
var/i = 0
while(i < length(.)) // They will collect all content of area that include *items on the turf*
var/atom/A = .[++i] // then all content on the turf will be collected, and this is again *items on the turf*.
. |= A.contents // |= ensures that there are no duplicates

///identical to getallcontents but returns a list of atoms of the type passed in the argument.
/atom/proc/get_all_contents_type(type)
var/list/processing_list = list(src)
. = list()
while(length(processing_list))
var/atom/A = processing_list[1]
processing_list.Cut(1, 2)
processing_list += A.contents
if(istype(A, type))
. += A

/atom/proc/GetAllContentsIgnoring(list/ignore_typecache)
if(!length(ignore_typecache))
return GetAllContents()
var/list/processing = list(src)
. = list()
var/i = 0
while(i < length(processing))
var/atom/A = processing[++i]
if(!ignore_typecache[A.type])
processing += A.contents
. += A

//Step-towards method of determining whether one atom can see another. Similar to viewers()
/proc/can_see(atom/source, atom/target, length=5) // I couldnt be arsed to do actual raycasting :I This is horribly inaccurate.
Expand Down Expand Up @@ -659,7 +686,7 @@ Turf and target are seperate in case you want to teleport some distance from a t

//Takes: Area type as text string or as typepath OR an instance of the area.
//Returns: A list of all turfs in areas of that type of that type in the world.
/proc/get_area_turfs(areatype, subtypes=TRUE, target_z = 0)
/proc/get_area_turfs(areatype, subtypes=TRUE, target_z = 0, list/black_list)
if(istext(areatype))
areatype = text2path(areatype)
else if(isarea(areatype))
Expand All @@ -676,6 +703,8 @@ Turf and target are seperate in case you want to teleport some distance from a t
if(!cache[A.type])
continue
for(var/turf/T in A)
if(black_list && (T.type in black_list))
continue
if(target_z == 0 || target_z == T.z)
turfs += T
else
Expand All @@ -684,6 +713,8 @@ Turf and target are seperate in case you want to teleport some distance from a t
if(A.type != areatype)
continue
for(var/turf/T in A)
if(black_list && (T.type in black_list))
continue
if(target_z == 0 || target_z == T.z)
turfs += T
return turfs
Expand Down
9 changes: 6 additions & 3 deletions code/controllers/configuration.dm
Expand Up @@ -137,15 +137,18 @@ var/list/net_announcer_secret = list()
var/expected_round_length = 90 MINUTES
// If the first delay has a custom start time
// No custom time
var/list/event_first_run = list(EVENT_LEVEL_MUNDANE = null,
var/list/event_first_run = list(EVENT_LEVEL_ROUNDSTART = null,
EVENT_LEVEL_MUNDANE = null,
EVENT_LEVEL_MODERATE = null,
EVENT_LEVEL_MAJOR = list("lower" = 50 MINUTES, "upper" = 70 MINUTES))
// The lowest delay until next event
var/list/event_delay_lower = list(EVENT_LEVEL_MUNDANE = 10 MINUTES,
var/list/event_delay_lower = list(EVENT_LEVEL_ROUNDSTART = null,
EVENT_LEVEL_MUNDANE = 10 MINUTES,
EVENT_LEVEL_MODERATE = 30 MINUTES,
EVENT_LEVEL_MAJOR = 50 MINUTES)
// The upper delay until next event
var/list/event_delay_upper = list(EVENT_LEVEL_MUNDANE = 15 MINUTES,
var/list/event_delay_upper = list(EVENT_LEVEL_ROUNDSTART = null,
EVENT_LEVEL_MUNDANE = 15 MINUTES,
EVENT_LEVEL_MODERATE = 45 MINUTES,
EVENT_LEVEL_MAJOR = 70 MINUTES)

Expand Down
23 changes: 18 additions & 5 deletions code/controllers/subsystem/events.dm
Expand Up @@ -10,15 +10,23 @@ SUBSYSTEM_DEF(events)
var/list/finished_events = list()
var/list/allEvents = list()
var/list/event_containers = list(
EVENT_LEVEL_MUNDANE = new/datum/event_container/mundane,
EVENT_LEVEL_MODERATE = new/datum/event_container/moderate,
EVENT_LEVEL_MAJOR = new/datum/event_container/major
EVENT_LEVEL_ROUNDSTART = new/datum/event_container/roundstart,
EVENT_LEVEL_MUNDANE = new/datum/event_container/mundane,
EVENT_LEVEL_MODERATE = new/datum/event_container/moderate,
EVENT_LEVEL_MAJOR = new/datum/event_container/major,
)

var/datum/event_meta/new_event = new

/datum/controller/subsystem/events/Initialize()
allEvents = subtypesof(/datum/event) - /datum/event/anomaly
var/list/black_types = list(
/datum/event/anomaly,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возможно вместо списка стоит проверять ивенты у которых нет имени

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У них нету переменной имени как таковой

/datum/event/roundstart,
/datum/event/roundstart/area,
/datum/event/roundstart/area/replace,
/datum/event/roundstart/area/maintenance_spawn,
)
allEvents = subtypesof(/datum/event) - black_types
return ..()

/datum/controller/subsystem/events/fire()
Expand All @@ -29,6 +37,11 @@ SUBSYSTEM_DEF(events)
var/datum/event_container/EC = event_containers[i]
EC.process()

/datum/controller/subsystem/events/proc/start_roundstart_event()
var/datum/event_container/roundstart/EC = event_containers[EVENT_LEVEL_ROUNDSTART]
for(var/i in 1 to rand(1, 3))
EC.start_event()

/datum/controller/subsystem/events/proc/event_complete(datum/event/E)
if(!E.event_meta) // datum/event is used here and there for random reasons, maintaining "backwards compatibility"
log_debug("Event of '[E.type]' with missing meta-data has completed.")
Expand All @@ -41,7 +54,7 @@ SUBSYSTEM_DEF(events)
if(!E.severity)
theseverity = EVENT_LEVEL_MODERATE

if(!E.severity == EVENT_LEVEL_MUNDANE && !E.severity == EVENT_LEVEL_MODERATE && !E.severity == EVENT_LEVEL_MAJOR)
if(E.severity != EVENT_LEVEL_ROUNDSTART && E.severity != EVENT_LEVEL_MUNDANE && E.severity != EVENT_LEVEL_MODERATE && E.severity != EVENT_LEVEL_MAJOR)
theseverity = EVENT_LEVEL_MODERATE //just to be careful

if(E.severity)
Expand Down
2 changes: 2 additions & 0 deletions code/controllers/subsystem/ticker.dm
Expand Up @@ -265,6 +265,8 @@ SUBSYSTEM_DEF(ticker)

spawn(0)//Forking here so we dont have to wait for this to finish
mode.post_setup()
SSevents.start_roundstart_event()

for(var/mob/dead/new_player/N in new_player_list)
if(N.client)
N.show_titlescreen()
Expand Down
12 changes: 6 additions & 6 deletions code/datums/helper_datums/events.dm
Expand Up @@ -24,7 +24,7 @@
return
addEventType(event_type)
var/list/event = events[event_type]
var/datum/event/E = new /datum/event(proc_holder,proc_name)
var/datum/event_mecha/E = new /datum/event_mecha(proc_holder,proc_name)
event += E
return E

Expand All @@ -35,12 +35,12 @@
var/list/event = listgetindex(events,args[1])
if(istype(event))
spawn(-1)
for(var/datum/event/E in event)
for(var/datum/event_mecha/E in event)
if(!E.Fire(arglist(args.Copy(2))))
clearEvent(args[1],E)
return

// Arguments: event_type as text, E as /datum/event
// Arguments: event_type as text, E as /datum/event_mecha
// Returns: 1 if event cleared, null on error
/datum/events/proc/clearEvent(event_type, datum/event/E)
if(!event_type || !E)
Expand All @@ -50,16 +50,16 @@
return 1


/datum/event
/datum/event_mecha
var/listener
var/proc_name

/datum/event/New(tlistener,tprocname)
/datum/event_mecha/New(tlistener,tprocname)
listener = tlistener
proc_name = tprocname
return ..()

/datum/event/proc/Fire()
/datum/event_mecha/proc/Fire()
//world << "Event fired"
if(listener)
call(listener,proc_name)(arglist(args))
Expand Down
8 changes: 3 additions & 5 deletions code/game/gamemodes/abduction/abduction_gear.dm
Expand Up @@ -274,12 +274,10 @@
radio_off_mob(M)

/obj/item/device/abductor/silencer/proc/radio_off_mob(mob/living/carbon/human/M)
var/list/all_items = M.GetAllContents()
var/list/all_items = M.get_all_contents_type(/obj/item/device/radio)

for(var/obj/I in all_items)
if(istype(I,/obj/item/device/radio))
var/obj/item/device/radio/r = I
r.on = 0
for(var/obj/item/device/radio/R in all_items)
R.on = 0


//RECALL IMPLANT
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/cult_datums.dm
Expand Up @@ -5,7 +5,7 @@
// Used only for sprite generation
var/list/words = list()

var/static/list/all_words = list("travel", "blood", "join", "hell", "destroy", "technology", "self", "see", "other", "hide")
var/static/list/all_words = RUNE_WORDS

/datum/rune/New(holder)
src.holder = holder
Expand Down
9 changes: 8 additions & 1 deletion code/game/gamemodes/cult/structures/rune.dm
Expand Up @@ -11,7 +11,7 @@
var/datum/religion/religion
var/mob/creator

/obj/effect/rune/atom_init(mapload, datum/religion/R, mob/user)
/obj/effect/rune/atom_init(mapload, datum/religion/R, mob/user, rand_icon = FALSE)
. = ..()
if(R)
ASSERT(user)
Expand All @@ -25,6 +25,13 @@
var/list/L = religion.runes_by_mob[creator]
L += src

if(rand_icon)
var/list/all_words = RUNE_WORDS
var/list/words = list()
for(var/i in 1 to 3)
words += pick_n_take(all_words)
icon = get_uristrune_cult(TRUE, words)

var/image/I = image('icons/effects/blood.dmi', src, "mfloor[rand(1, 7)]", 2)
I.override = TRUE
I.color = "#a10808"
Expand Down
5 changes: 3 additions & 2 deletions code/game/machinery/doors/airlock.dm
Expand Up @@ -622,8 +622,9 @@ var/list/airlock_overlays = list()
var/obj/structure/door_assembly/da = new assembly_type(loc)
da.anchored = 0
var/target = da.loc
for(var/i in 1 to 4)
target = get_turf(get_step(target,user.dir))
if(user)
for(var/i in 1 to 4)
target = get_turf(get_step(target,user.dir))
da.throw_at(target, 200, 100, spin = FALSE)
if(mineral)
da.change_mineral_airlock_type(mineral)
Expand Down
2 changes: 1 addition & 1 deletion code/game/magic/Uristrunes.dm
Expand Up @@ -4,7 +4,7 @@
word_to_uristrune_table = list()

var/bit = 1
var/list/words = list("travel", "blood", "join", "hell", "destroy", "technology", "self", "see", "other", "hide")
var/list/words = RUNE_WORDS

while(length(words))
var/w = pick(words)
Expand Down
8 changes: 8 additions & 0 deletions code/game/objects/items/weapons/storage/storage.dm
Expand Up @@ -517,3 +517,11 @@
for(var/obj/O in contents)
remove_from_storage(O, T)
INVOKE_ASYNC(O, /obj.proc/tumble_async, 2)

/obj/item/weapon/storage/proc/make_empty(delete = TRUE)
var/turf/T = get_turf(src)
for(var/A in contents)
if(delete)
qdel(A)
else
remove_from_storage(A, T)
Expand Up @@ -195,6 +195,10 @@
icon_broken = "secbroken"
icon_off = "secoff"

/obj/structure/closet/secure_closet/security/atom_init(mapload)
. = ..()
sec_closets_list += src

/obj/structure/closet/secure_closet/security/PopulateContents()
if(prob(50))
new /obj/item/weapon/storage/backpack/security(src)
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/structures/tank_dispenser.dm
Expand Up @@ -22,6 +22,8 @@
. = ..()
update_icon()

tank_dispenser_list += src


/obj/structure/dispenser/update_icon()
cut_overlays()
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/watercloset.dm
Expand Up @@ -16,6 +16,7 @@
. = ..()
open = round(rand(0, 1))
update_icon()
toilet_list += src

/obj/structure/toilet/attack_hand(mob/living/user)
user.SetNextMove(CLICK_CD_MELEE * 1.5)
Expand Down
5 changes: 1 addition & 4 deletions code/modules/events/_event.dm
Expand Up @@ -167,10 +167,7 @@

event_meta = EM
severity = event_meta.severity
if(severity < EVENT_LEVEL_MUNDANE)
severity = EVENT_LEVEL_MUNDANE
if(severity > EVENT_LEVEL_MAJOR)
severity = EVENT_LEVEL_MAJOR
severity = clamp(severity, EVENT_LEVEL_ROUNDSTART, EVENT_LEVEL_MAJOR)

startedAt = world.time

Expand Down