Skip to content

Commit

Permalink
make everything datum
Browse files Browse the repository at this point in the history
  • Loading branch information
HelmsDeepState committed Apr 13, 2024
1 parent 9dc05a4 commit a4a4192
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 102 deletions.
1 change: 1 addition & 0 deletions modular_ss220/antagonists/_antagonists.dme
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
#include "code/rave_wizard/beer_missiles.dm"
#include "code/rave_wizard/great_revelry.dm"
#include "code/rave_wizard/rocker_touch.dm"
#include "code/rave_wizard/datum/rave_wizard.dm"
27 changes: 5 additions & 22 deletions modular_ss220/antagonists/code/rave_wizard/beer_missiles.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/effect/proc_holder/spell/projectile/beer_missile
/datum/spell/projectile/magic_missile/beer
name = "Beer Missile"
desc = "This spell fires several, slow moving, magic beer bottles at nearby targets"
school = "evocation"
Expand All @@ -11,7 +11,7 @@
proj_icon_state = "beer"
proj_name = "A bottle of beer"
proj_lingering = 1
proj_type = "/obj/effect/proc_holder/spell/inflict_handler/beer_missile"
proj_type = "/obj/item/projectile/magic/magic_missile/beer"
proj_lifespan = 20
proj_step_delay = 5
proj_trail_icon = 'icons/obj/drinks.dmi'
Expand All @@ -23,29 +23,12 @@
action_icon = 'modular_ss220/antagonists/icons/rave.dmi'
sound = 'sound/magic/magic_missile.ogg'

/obj/effect/proc_holder/spell/projectile/beer_missile/create_new_targeting()
var/datum/spell_targeting/targeted/T = new()
T.allowed_type = /mob/living
T.max_targets = INFINITY
return T

/obj/effect/proc_holder/spell/inflict_handler/beer_missile
sound = "shatter"
/obj/item/projectile/magic/magic_missile/beer
hitsound = "shatter"
var/debuff_effect_duration = 10 SECONDS

/obj/effect/proc_holder/spell/inflict_handler/beer_missile/cast(list/targets, mob/user = usr)
for(var/mob/living/target in targets)
target.AdjustKnockDown(debuff_effect_duration)
target.AdjustDizzy(debuff_effect_duration)
target.AdjustSlur(debuff_effect_duration)
target.AdjustConfused(debuff_effect_duration)
target.AdjustEyeBlurry(debuff_effect_duration)
target.AdjustDrowsy(debuff_effect_duration)
target.AdjustDruggy(debuff_effect_duration)
. = ..()

/datum/spellbook_entry/beer_missile
name = "Magic beer missiles"
spell_type = /obj/effect/proc_holder/spell/projectile/beer_missile
spell_type = /datum/spell/projectile/magic_missile/beer
category = "Rave"

4 changes: 2 additions & 2 deletions modular_ss220/antagonists/code/rave_wizard/dancing_field.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/effect/proc_holder/spell/aoe/conjure/timestop/dance
/datum/spell/aoe/conjure/timestop/dance
name = "Dance Time"
desc = "This spell makes everyone dance in it's range. Enchanted targets cannot attack, but projectiles harm as usual"
invocation = "DAN SIN FIVA"
Expand Down Expand Up @@ -55,7 +55,7 @@

/datum/spellbook_entry/dancestop
name = "Dance Stop"
spell_type = /obj/effect/proc_holder/spell/aoe/conjure/timestop/dance
spell_type = /datum/spell/aoe/conjure/timestop/dance
category = "Rave"

/obj/effect/timestop/dancing/wizard
Expand Down
79 changes: 79 additions & 0 deletions modular_ss220/antagonists/code/rave_wizard/datum/rave_wizard.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#define SPELLBOOK_AVAILABLE_POINTS 4
/datum/antagonist/wizard/rave

/datum/objective/wizrave
explanation_text = "Устройте вечеринку, о которой потомки будут слагать легенды."
needs_target = FALSE
completed = TRUE

/datum/antagonist/wizard/rave/give_objectives()
add_antag_objective(/datum/objective/wizrave)

/datum/antagonist/wizard/rave/on_gain()
. = ..()
var/spell_paths = list(/datum/spell/projectile/magic_missile/beer,
/datum/spell/aoe/conjure/timestop/dance,
/datum/spell/great_revelry,
/datum/spell/touch/touch/rocker,
/datum/spell/aoe/conjure/summon_disco)
for(var/spell_path in spell_paths)
var/S = new spell_path
owner.AddSpell(S)

/datum/antagonist/wizard/equip_wizard() //copypasta to make spellbook adjustments
if(!ishuman(owner.current))
return
var/mob/living/carbon/human/new_wiz = owner.current

//So zards properly get their items when they are admin-made.
qdel(new_wiz.wear_suit)
qdel(new_wiz.head)
qdel(new_wiz.shoes)
qdel(new_wiz.r_hand)
qdel(new_wiz.r_store)
qdel(new_wiz.l_store)

if(isplasmaman(new_wiz))
new_wiz.equipOutfit(new /datum/outfit/plasmaman/wizard)
new_wiz.internal = new_wiz.r_hand
new_wiz.update_action_buttons_icon()
else
new_wiz.equip_to_slot_or_del(new /obj/item/clothing/under/color/lightpurple(new_wiz), SLOT_HUD_JUMPSUIT)
new_wiz.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(new_wiz), SLOT_HUD_HEAD)
new_wiz.dna.species.after_equip_job(null, new_wiz)
new_wiz.rejuvenate() //fix any damage taken by naked vox/plasmamen/etc while round setups
new_wiz.equip_to_slot_or_del(new /obj/item/radio/headset(new_wiz), SLOT_HUD_LEFT_EAR)
new_wiz.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(new_wiz), SLOT_HUD_SHOES)
new_wiz.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(new_wiz), SLOT_HUD_OUTER_SUIT)
new_wiz.equip_to_slot_or_del(new /obj/item/storage/backpack/satchel(new_wiz), SLOT_HUD_BACK)
if(new_wiz.dna.species.speciesbox)
new_wiz.equip_to_slot_or_del(new new_wiz.dna.species.speciesbox(new_wiz), SLOT_HUD_IN_BACKPACK)
else
new_wiz.equip_to_slot_or_del(new /obj/item/storage/box/survival(new_wiz), SLOT_HUD_IN_BACKPACK)
new_wiz.equip_to_slot_or_del(new /obj/item/teleportation_scroll(new_wiz), SLOT_HUD_RIGHT_STORE)
var/obj/item/spellbook/spellbook = new /obj/item/spellbook(new_wiz)
spellbook.owner = new_wiz
spellbook.remove_harmful_spells_and_items()
spellbook.uses = SPELLBOOK_AVAILABLE_POINTS
new_wiz.equip_to_slot_or_del(spellbook, SLOT_HUD_LEFT_HAND)

var/list/reading = list()
reading += "You will find a list of available spells in your spell book. Choose your magic arsenal carefully."
reading += "The spellbook is bound to you, and others cannot use it."
reading += "In your pockets you will find a teleport scroll. Use it as needed."
new_wiz.mind.store_memory("<B>Remember:</B> do not forget to prepare your spells.")
new_wiz.update_icons()
new_wiz.gene_stability += DEFAULT_GENE_STABILITY //magic
return reading

/obj/item/spellbook/proc/remove_harmful_spells_and_items()
main_categories -= "Magical Items"
main_categories -= "Loadouts"
spell_categories -= "Offensive"
spell_categories -= "Rituals"

/datum/spellbook_entry/summon_supermatter
category = "Offensive"

/datum/spellbook_entry/rathens
category = "Offensive"
10 changes: 5 additions & 5 deletions modular_ss220/antagonists/code/rave_wizard/great_revelry.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/effect/proc_holder/spell/great_revelry
/datum/spell/great_revelry
name = "Ritual of Great Revelry"
desc = "Gives everyone a beckoning bottle of alcohol, forcing them to drop an item from their hand."

Expand All @@ -20,10 +20,10 @@
action_background_icon_state = "revelry"
action_icon = 'modular_ss220/antagonists/icons/rave.dmi'

/obj/effect/proc_holder/spell/great_revelry/create_new_targeting()
/datum/spell/great_revelry/create_new_targeting()
return new /datum/spell_targeting/self

/obj/effect/proc_holder/spell/great_revelry/cast(list/targets, mob/user = usr)
/datum/spell/great_revelry/cast(list/targets, mob/user = usr)
for(var/mob/living/carbon/human/H in GLOB.player_list)
var/turf/T = get_turf(H)
if(T && is_away_level(T.z))
Expand All @@ -36,13 +36,13 @@
give_alcohol(H)


/obj/effect/proc_holder/spell/great_revelry/proc/give_alcohol(mob/living/carbon/human/H)
/datum/spell/great_revelry/proc/give_alcohol(mob/living/carbon/human/H)
var/bottle_type = pick(beverages)
var/obj/item/bottle = new bottle_type(get_turf(H))
playsound(get_turf(H),'modular_ss220/antagonists/sound/beer_can_open.ogg', 50, TRUE)
H.put_in_hands(bottle)

/datum/spellbook_entry/great_revelry
name = "Ritual of Great Revelry"
spell_type = /obj/effect/proc_holder/spell/great_revelry
spell_type = /datum/spell/great_revelry
category = "Rave"
71 changes: 3 additions & 68 deletions modular_ss220/antagonists/code/rave_wizard/rave_wizard_event.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define SPELLBOOK_AVAILABLE_POINTS 4
#define MAGIVENDS_PRODUCTS_REFILL_VALUE 20
#define WIZARD_WIKI ("<span class='motd'>На вики-странице доступна более подробная информация: ([GLOB.configuration.url.wiki_url]/index.php/Wizard)</span>")
#define RAVE_WIZARD_EVENT_WEIGHT 5
Expand All @@ -23,7 +22,9 @@
if(new_wizard)

var/mob/living/carbon/human/new_character = makeBody(new_wizard)
new_character.mind.make_rave_wizard()
var/datum/antagonist/wizard/rave_wizard = new /datum/antagonist/wizard/rave()
new_character.mind.add_antag_datum(rave_wizard)
new_character.forceMove(pick(GLOB.wizardstart))
// This puts them at the wizard spawn, worry not
new_character.equip_to_slot_or_del(new /obj/item/reagent_containers/drinks/mugwort(new_wizard), SLOT_HUD_IN_BACKPACK)
new_character.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses, SLOT_HUD_GLASSES)
Expand Down Expand Up @@ -53,71 +54,6 @@
magic.product_records.Cut()
magic.build_inventory(magic.products, magic.product_records)

/datum/mind/proc/make_rave_wizard()
if(!(src in SSticker.mode.wizards))
SSticker.mode.wizards += src
special_role = SPECIAL_ROLE_WIZARD
assigned_role = SPECIAL_ROLE_WIZARD
//ticker.mode.learn_basic_spells(current)
if(!GLOB.wizardstart.len)
current.loc = pick(GLOB.latejoin)
to_chat(current, "HOT INSERTION, GO GO GO")
else
current.loc = pick(GLOB.wizardstart)

SSticker.mode.equip_wizard(current)
src.learn_rave_spells()
for(var/obj/item/spellbook/S in current.contents)
S.op = 0
S.remove_harmful_spells_and_items()
S.uses = SPELLBOOK_AVAILABLE_POINTS
SSticker.mode.forge_rave_wizard_objectives(src)
SSticker.mode.greet_rave_wizard(src)
SSticker.mode.update_wiz_icons_added(src)
SSticker.mode.name_wizard(current)

/datum/mind/proc/learn_rave_spells()
var/spell_paths = list(/obj/effect/proc_holder/spell/projectile/beer_missile,
/obj/effect/proc_holder/spell/aoe/conjure/timestop/dance,
/obj/effect/proc_holder/spell/great_revelry,
/obj/effect/proc_holder/spell/touch/rocker,
/obj/effect/proc_holder/spell/aoe/conjure/summon_disco)
for(var/spell_path in spell_paths)
var/S = new spell_path
src.AddSpell(S)

/obj/item/spellbook/proc/remove_harmful_spells_and_items()
main_categories -= "Magical Items"
main_categories -= "Loadouts"
spell_categories -= "Offensive"
spell_categories -= "Rituals"


/datum/spellbook_entry/summon_supermatter
category = "Offensive"

/datum/spellbook_entry/rathens
category = "Offensive"

/datum/game_mode/proc/greet_rave_wizard(datum/mind/wizard, you_are=TRUE)
SEND_SOUND(wizard.current, sound('sound/ambience/antag/ragesmages.ogg'))
var/list/messages = list()
if(you_are)
messages.Add(span_danger("Вы — маг рейва!"))

messages.Add(wizard.prepare_announce_objectives(title = FALSE))
messages.Add(WIZARD_WIKI)
to_chat(wizard.current, chat_box_red(messages.Join("<br>")))
wizard.current.create_log(MISC_LOG, "[wizard.current] was made into a wizard")

/datum/game_mode/proc/forge_rave_wizard_objectives(datum/mind/wizard)
wizard.add_mind_objective(/datum/objective/wizrave)

/datum/objective/wizrave
explanation_text = "Устройте вечеринку, о которой потомки будут слагать легенды."
needs_target = FALSE
completed = TRUE

/datum/event_container/major/New()
. = ..()
ASSERT(length(available_events) > 0)
Expand All @@ -127,5 +63,4 @@

#undef MAGIVENDS_PRODUCTS_REFILL_VALUE
#undef WIZARD_WIKI
#undef SPELLBOOK_AVAILABLE_POINTS
#undef RAVE_WIZARD_EVENT_WEIGHT
4 changes: 2 additions & 2 deletions modular_ss220/antagonists/code/rave_wizard/rocker_touch.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define DRUGS_AMOUNT_INJECTED_BY_TUMOR 20
#define ALCOHOL_AMOUNT_INJECTED_BY_TUMOR 20

/obj/effect/proc_holder/spell/touch/rocker
/datum/spell/touch/touch/rocker
name = "Rocker Touch"
desc = "Teach those foolish suits how to spend time in style"
hand_path = /obj/item/melee/touch_attack/rocker
Expand All @@ -22,7 +22,7 @@

/datum/spellbook_entry/rocker_curse
name = "Alcoholism curse"
spell_type = /obj/effect/proc_holder/spell/touch/rocker
spell_type = /datum/spell/touch/touch/rocker
category = "Rave"
cost = 1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/effect/proc_holder/spell/aoe/conjure/summon_disco
/datum/spell/aoe/conjure/summon_disco
name = "Summon Disco Ball"
desc = "Summons a disco ball"
base_cooldown = 400 SECONDS
Expand All @@ -13,7 +13,7 @@
action_icon = 'modular_ss220/antagonists/icons/rave.dmi'
var/obj/machinery/jukebox/disco/indestructible/our_disco

/obj/effect/proc_holder/spell/aoe/conjure/summon_disco/cast(list/targets, mob/living/user = usr)
/datum/spell/aoe/conjure/summon_disco/cast(list/targets, mob/living/user = usr)
if(!our_disco)
var/list/summoned_items = ..()
if(summoned_items || summoned_items.len > 0)
Expand All @@ -25,6 +25,6 @@

/datum/spellbook_entry/summon_disco
name = "Summon Disco Ball"
spell_type = /obj/effect/proc_holder/spell/aoe/conjure/summon_disco
spell_type = /datum/spell/aoe/conjure/summon_disco
cost = 1
category = "Rave"

0 comments on commit a4a4192

Please sign in to comment.