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

add: midround space wizards! #6023

Open
wants to merge 5 commits into
base: master220
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/game/gamemodes/wizard/spellbook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@
var/entry_types = subtypesof(/datum/spellbook_entry) - /datum/spellbook_entry/item - /datum/spellbook_entry/summon - /datum/spellbook_entry/loadout
for(var/T in entry_types)
var/datum/spellbook_entry/E = new T
if(GAMEMODE_IS_RAGIN_MAGES && E.is_ragin_restricted)
if((GAMEMODE_IS_RAGIN_MAGES || (GLOB.wizard_events_triggered > 0)) && E.is_ragin_restricted)
qdel(E)
continue
entries |= E
Expand Down
1 change: 1 addition & 0 deletions code/modules/events/event_container.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ GLOBAL_LIST_EMPTY(event_last_fired)
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Теневой Демон", /datum/event/spawn_slaughter/shadow, 20, is_one_shot = TRUE),
//new /datum/event_meta(EVENT_LEVEL_MAJOR, "Floor Cluwne", /datum/event/spawn_floor_cluwne, 15, is_one_shot = TRUE)
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Космический Дракон", /datum/event/space_dragon, 20, list(ASSIGNMENT_SECURITY = 4), TRUE),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Рейд ФКВ", /datum/event/space_wizards, 30, list(ASSIGNMENT_SECURITY = 5), TRUE),
)


Expand Down
44 changes: 44 additions & 0 deletions code/modules/events/wizards.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#define MINIMUM_CREW_REQ 10
#define CREW_PER_WIZARD 30
GLOBAL_VAR_INIT(wizard_events_triggered, 0)
/datum/event/space_wizards
name = "Рейд ФКВ"
var/mages_made

/datum/event/space_wizards/start()
INVOKE_ASYNC(src, PROC_REF(wrappedstart))

/datum/event/space_wizards/proc/get_wizards_number()
if(num_station_players() <= MINIMUM_CREW_REQ)
return 0

return floor(num_station_players() / CREW_PER_WIZARD) || 1 //every mage each 30 crew


/datum/event/space_wizards/proc/wrappedstart()
var/mages_number = get_wizards_number()

if(mages_number < 1)
log_and_message_admins("Warning: Could not spawn any mobs for event Wizard Raid. Reason - not enough players.")
var/datum/event_container/EC = SSevents.event_containers[EVENT_LEVEL_MAJOR]
EC.next_event_time = world.time + (60 SECONDS)
return

var/image/source = image('icons/obj/cardboard_cutout.dmi', "cutout_wizard")
var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as a Space Wizard?", ROLE_WIZARD, TRUE, poll_time = 60 SECONDS, source = source)
if(!candidates.len)
log_and_message_admins("Warning: Could not spawn any mobs for event Wizard Raid. Reason - not enough candidates.")
var/datum/event_container/EC = SSevents.event_containers[EVENT_LEVEL_MAJOR]
EC.next_event_time = world.time + (60 SECONDS)

Comment on lines +29 to +33
Copy link
Contributor

Choose a reason for hiding this comment

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

раз уж нет кандидатов, то в конце твоих манипуляций с кулдауном нужно поставить return

while(mages_number && length(candidates))
var/mob/new_mage = pick_n_take(candidates)
if(new_mage)
GLOB.wizard_events_triggered += 1
var/mob/living/carbon/human/new_character= makeBody(new_mage)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
var/mob/living/carbon/human/new_character= makeBody(new_mage)
var/mob/living/carbon/human/new_character = makeBody(new_mage)

new_character.mind.make_Wizard() // This puts them at the wizard spawn, worry not
mages_number--
log_game("Spawned [new_character] (ckey: [new_character.key]) as midround Wizard.")
Comment on lines +34 to +41
Copy link
Contributor

Choose a reason for hiding this comment

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

учитывая прошлый комментарий - это легче и лучше будет переписать на for


#undef MINIMUM_CREW_REQ
#undef CREW_PER_WIZARD
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2053,6 +2053,7 @@
#include "code\modules\events\undead.dm"
#include "code\modules\events\vent_clog.dm"
#include "code\modules\events\wallrot.dm"
#include "code\modules\events\wizards.dm"
#include "code\modules\events\wormholes.dm"
#include "code\modules\events\wizard\ghost.dm"
#include "code\modules\fish\fish_eggs.dm"
Expand Down