Skip to content

Commit

Permalink
Magic rework (#476)
Browse files Browse the repository at this point in the history
* Starting commit

* Adjustments

* Globals generated

* Chance to have higher mana/spell points for job spawns

* Dispell projectile, more tweaks to spell book

* Tweak & Fixes

* Aimed healing

* Fix

* Category for dispells

* Fixes

* Trance duration fix

* Health analyze improvement

* Fix veil of shadows

* Silly spells

* Some tweaks and fixes

* Aimed swap + some tweaks

* Tweaks + Sounds

* Magic orbs + Moving mana to mind

* Tweaks & Fixes

* Water slash, more tweaks

* Water slash fixes/tweaks

* Fix aimed "charge refunding"

* Fixes

* Fixes...

* And fixes.....

* Another one

* Fix... Please...

* Spellbook upgrades

* Fix spellbook

* Water slash stuff

* Tweaks & Fixes

* Fixes & Tweaks, again

* Water slash checks in range instead of view

* Flamethrower spell, more tweaks, remove "tower" subtypes

* Tweaks!

* Wizard den away site update

* Fix

* Remove map files that aren't added yet.

* Oopsie

* Fixes

* Fixes naming of planetoid away sites

* Some updates

* Some tweaks

* You can now write spells into the spellbook

Using magic quill, you can add spells that you know to it.

* End of everything :)

* Fix

* Assorted fixes

* a

* Fix

* Onrush spell

* Multitude of updates

Code improvements, added fire ring and corpse explosion spells

* Tweaks & Fixes

* Gives corpse explosion an appropriate cooldown

* Decoy effect fix

* Linter fix

* Tweaks + Aimed blink

* More tweaks!

* Fix/buff dispell effect on mobs

* Updates

* Balance & tweaks

* Fix runtime

* Should fix onrush

* oopsie

* fix

* Healing spells tweaks & buffs

* Tweaks & Fixes

* Revive, not rejuvenate

* Fix random spellbooks

* Missing parent call

* More epic updates!

Consume magic & Mana burn spells added

* Mana burn icon

* Spell steal!

* Fixes

* More fixes

* Batch of fixes

* Nerfs polymorph

* Some more tweaks

* Consume magic sounds

* Minor fixes

* Dispell projectile tweaks

* Minor balance

* More fixes

* Stuncuff spell nerf

* Rebalance of healing spells, fix end of everything

* Counter crystal spell

* Some tweaks & fixes

* Mend structures spell & Code tweaks

* Adds turfs to mend structures

* Variety of tweaks & fixes

* Rework spell upgrade code

* Tiny fix + Show max amount of upgrades in the spell book

* Fixes

* Makes certain spells invisible from normal books

* Numerous bug fixes, adds restore limbs spell

* Mana Drain, a lot of improvements

* Updates CSS styles

* Random blink nerfs

* Tweaks warning span color
  • Loading branch information
EgorDinamit authored Jan 31, 2024
1 parent 40aa208 commit 721486e
Show file tree
Hide file tree
Showing 162 changed files with 44,286 additions and 1,548 deletions.
47 changes: 32 additions & 15 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include "code\__defines\lighting.dm"
#include "code\__defines\lists.dm"
#include "code\__defines\machinery.dm"
#include "code\__defines\magic.dm"
#include "code\__defines\mapping.dm"
#include "code\__defines\materials.dm"
#include "code\__defines\math_physics.dm"
Expand Down Expand Up @@ -910,6 +911,7 @@
#include "code\game\objects\effects\gibs.dm"
#include "code\game\objects\effects\item_pickup_ghost.dm"
#include "code\game\objects\effects\landmarks.dm"
#include "code\game\objects\effects\magic_orb.dm"
#include "code\game\objects\effects\manifest.dm"
#include "code\game\objects\effects\mapping_helpers.dm"
#include "code\game\objects\effects\mines.dm"
Expand Down Expand Up @@ -1209,7 +1211,7 @@
#include "code\game\objects\structures\bedsheet_bin.dm"
#include "code\game\objects\structures\catwalk.dm"
#include "code\game\objects\structures\charge_pylon.dm"
#include "code\game\objects\structures\coathanger.dm"
#include "code\game\objects\structures\coatrack.dm"
#include "code\game\objects\structures\curtains.dm"
#include "code\game\objects\structures\displaycase.dm"
#include "code\game\objects\structures\dogbed.dm"
Expand Down Expand Up @@ -2048,6 +2050,8 @@
#include "code\modules\locks\key.dm"
#include "code\modules\locks\lock.dm"
#include "code\modules\locks\lock_construct.dm"
#include "code\modules\mana\mana.dm"
#include "code\modules\mana\mind.dm"
#include "code\modules\maps\dmm_suite.dm"
#include "code\modules\maps\helper_landmarks.dm"
#include "code\modules\maps\map_template.dm"
Expand Down Expand Up @@ -2760,6 +2764,7 @@
#include "code\modules\paperwork\pen\chameleon_pen.dm"
#include "code\modules\paperwork\pen\crayon.dm"
#include "code\modules\paperwork\pen\fancy.dm"
#include "code\modules\paperwork\pen\magic_quill.dm"
#include "code\modules\paperwork\pen\multi_pen.dm"
#include "code\modules\paperwork\pen\pen.dm"
#include "code\modules\paperwork\pen\reagent_pen.dm"
Expand Down Expand Up @@ -3139,6 +3144,7 @@
#include "code\modules\species\station\skrell.dm"
#include "code\modules\species\station\unathi.dm"
#include "code\modules\species\station\unathi_subspecies.dm"
#include "code\modules\spellbook\_spellbook.dm"
#include "code\modules\spells\_spell.dm"
#include "code\modules\spells\_spell_procs.dm"
#include "code\modules\spells\artifacts.dm"
Expand All @@ -3147,17 +3153,31 @@
#include "code\modules\spells\no_clothes.dm"
#include "code\modules\spells\racial_wizard.dm"
#include "code\modules\spells\spell_projectile.dm"
#include "code\modules\spells\spellbook.dm"
#include "code\modules\spells\aimed\_aimed.dm"
#include "code\modules\spells\aimed\blink.dm"
#include "code\modules\spells\aimed\corpse_explosion.dm"
#include "code\modules\spells\aimed\counter_crystal.dm"
#include "code\modules\spells\aimed\dispell.dm"
#include "code\modules\spells\aimed\fireball.dm"
#include "code\modules\spells\aimed\flamethrower.dm"
#include "code\modules\spells\aimed\healing.dm"
#include "code\modules\spells\aimed\mana_burn.dm"
#include "code\modules\spells\aimed\mana_drain.dm"
#include "code\modules\spells\aimed\onrush.dm"
#include "code\modules\spells\aimed\passage.dm"
#include "code\modules\spells\aimed\restore_limbs.dm"
#include "code\modules\spells\aimed\spark_bolt.dm"
#include "code\modules\spells\aimed\spell_steal.dm"
#include "code\modules\spells\aimed\swap.dm"
#include "code\modules\spells\aimed\water_slash.dm"
#include "code\modules\spells\aoe_turf\aoe_turf.dm"
#include "code\modules\spells\aoe_turf\blink.dm"
#include "code\modules\spells\aoe_turf\charge.dm"
#include "code\modules\spells\aoe_turf\disable_tech.dm"
#include "code\modules\spells\aoe_turf\drain_blood.dm"
#include "code\modules\spells\aoe_turf\exchange_wounds.dm"
#include "code\modules\spells\aoe_turf\fire_ring.dm"
#include "code\modules\spells\aoe_turf\knock.dm"
#include "code\modules\spells\aoe_turf\random_blink.dm"
#include "code\modules\spells\aoe_turf\smoke.dm"
#include "code\modules\spells\aoe_turf\summons.dm"
#include "code\modules\spells\aoe_turf\conjure\conjure.dm"
Expand All @@ -3173,6 +3193,7 @@
#include "code\modules\spells\general\area_teleport.dm"
#include "code\modules\spells\general\contract_spells.dm"
#include "code\modules\spells\general\create_air.dm"
#include "code\modules\spells\general\end_of_everything.dm"
#include "code\modules\spells\general\invisibility.dm"
#include "code\modules\spells\general\mark_recall.dm"
#include "code\modules\spells\general\portal_teleport.dm"
Expand All @@ -3181,33 +3202,29 @@
#include "code\modules\spells\general\tear_veil.dm"
#include "code\modules\spells\general\toggle_armor.dm"
#include "code\modules\spells\general\veil_of_shadows.dm"
#include "code\modules\spells\hand\_hand.dm"
#include "code\modules\spells\hand\_hand_item.dm"
#include "code\modules\spells\hand\analyze_health.dm"
#include "code\modules\spells\hand\blood_shards.dm"
#include "code\modules\spells\hand\burning_grip.dm"
#include "code\modules\spells\hand\consume_magic.dm"
#include "code\modules\spells\hand\entangle.dm"
#include "code\modules\spells\hand\hand.dm"
#include "code\modules\spells\hand\hand_item.dm"
#include "code\modules\spells\hand\mend_structures.dm"
#include "code\modules\spells\hand\slippery_surface.dm"
#include "code\modules\spells\hand\sunwrath.dm"
#include "code\modules\spells\spellbook\battlemage.dm"
#include "code\modules\spells\spellbook\cleric.dm"
#include "code\modules\spells\spellbook\druid.dm"
#include "code\modules\spells\spellbook\spatial.dm"
#include "code\modules\spells\spellbook\standard.dm"
#include "code\modules\spells\spellbook\student.dm"
#include "code\modules\spells\targeted\_targeted.dm"
#include "code\modules\spells\targeted\analyze.dm"
#include "code\modules\spells\targeted\blood_boil.dm"
#include "code\modules\spells\targeted\cleric_spells.dm"
#include "code\modules\spells\targeted\ethereal_jaunt.dm"
#include "code\modules\spells\targeted\exhude_pleasantness.dm"
#include "code\modules\spells\targeted\genetic.dm"
#include "code\modules\spells\targeted\glimpse_of_eternity.dm"
#include "code\modules\spells\targeted\harvest.dm"
#include "code\modules\spells\targeted\healing.dm"
#include "code\modules\spells\targeted\pestilence.dm"
#include "code\modules\spells\targeted\shapeshift.dm"
#include "code\modules\spells\targeted\shatter_mind.dm"
#include "code\modules\spells\targeted\shift.dm"
#include "code\modules\spells\targeted\subjugate.dm"
#include "code\modules\spells\targeted\swap.dm"
#include "code\modules\spells\targeted\torment.dm"
#include "code\modules\spells\targeted\equip\_equip.dm"
#include "code\modules\spells\targeted\equip\burning_touch.dm"
Expand All @@ -3220,7 +3237,6 @@
#include "code\modules\spells\targeted\projectile\dumbfire.dm"
#include "code\modules\spells\targeted\projectile\magic_missile.dm"
#include "code\modules\spells\targeted\projectile\projectile.dm"
#include "code\modules\spells\targeted\projectile\stuncuff.dm"
#include "code\modules\sprite_accessories\_accessory.dm"
#include "code\modules\sprite_accessories\_accessory_facial.dm"
#include "code\modules\sprite_accessories\_accessory_hair.dm"
Expand Down Expand Up @@ -3431,6 +3447,7 @@
#include "maps\antag_spawn\ninja\ninja.dm"
#include "maps\antag_spawn\wizard\wizard.dm"
#include "maps\away\away_sites.dm"
#include "maps\away\wizard_den\wizard_den.dm"
#include "maps\away_sites_testing\away_sites_testing_define.dm"
#include "maps\example\example_define.dm"
#include "maps\random_rooms\_random_room.dm"
Expand Down
3 changes: 3 additions & 0 deletions code/__defines/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,6 @@
// Colors for input/hotkey panel.
#define COLOR_INPUT_DISABLED "#f0f0f0"
#define COLOR_INPUT_ENABLED "#d3b5b5"

// Misc
#define COLOR_MANA "#47f0ff"
15 changes: 15 additions & 0 deletions code/__defines/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
#define COMSIG_GLOB_MOB_CREATED "!mob_created"
/// Mob died somewhere : (mob/living, gibbed)
#define COMSIG_GLOB_MOB_DEATH "!mob_death"
/// A magic orb was picked up by a mob: (orb, mob/living)
#define COMSIG_GLOB_ORB_PICKUP "!orb_picked"
/// When spell is cast; (user, spell, targets)
#define COMSIG_GLOB_SPELL_CAST "!spell_cast"
/// When hand type spell cast_hand is called; (user, spell, target)
#define COMSIG_GLOB_SPELL_CAST_HAND "!spell_cast_hand"

//////////////////////////////////////////////////////////////////

Expand All @@ -32,6 +38,15 @@
// /atom signals

// /atom/movable signals
/// When an atom's Dispell() proc is called; Passes dispell strength as argument.
#define COMSIG_ATOM_MOVABLE_DISPELL "atom_dispell"
// Return value of a signal handler if dispell should be blocked
#define COMPONENT_DISPELL_BLOCKED (1 << 0)

/// When spell is cast; (user, spell, targets)
#define COMSIG_SPELL_CAST "spell_cast"
/// When hand type spell cast_hand is called; (user, spell, target)
#define COMSIG_SPELL_CAST_HAND "spell_cast_hand"

// /area signals

Expand Down
40 changes: 0 additions & 40 deletions code/__defines/gamemode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,46 +60,6 @@
#define DEFAULT_TELECRYSTAL_AMOUNT 130
#define IMPLANT_TELECRYSTAL_AMOUNT(x) (round(x * 0.49)) // If this cost is ever greater than half of DEFAULT_TELECRYSTAL_AMOUNT then it is possible to buy more TC than you spend

/////////////////
////WIZARD //////
/////////////////

/* WIZARD SPELL FLAGS */
#define GHOSTCAST 0x1 //can a ghost cast it?
#define NEEDSCLOTHES 0x2 //does it need the wizard garb to cast? Nonwizard spells should not have this
#define NEEDSHUMAN 0x4 //does it require the caster to be human?
#define Z2NOCAST 0x8 //if this is added, the spell can't be cast at centcomm
#define NO_SOMATIC 0x10 //spell will go off if the person is incapacitated or stunned
#define IGNOREPREV 0x20 //if set, each new target does not overlap with the previous one
//The following flags only affect different types of spell, and therefore overlap
//Targeted spells
#define INCLUDEUSER 0x40 //does the spell include the caster in its target selection?
#define SELECTABLE 0x80 //can you select each target for the spell?
#define NOFACTION 0x1000 //Don't do the same as our faction
#define NONONFACTION 0x2000 //Don't do people other than our faction
//AOE spells
#define IGNOREDENSE 0x40 //are dense turfs ignored in selection?
#define IGNORESPACE 0x80 //are space turfs ignored in selection?
//End split flags
#define CONSTRUCT_CHECK 0x100 //used by construct spells - checks for nullrods
#define NO_BUTTON 0x200 //spell won't show up in the HUD with this

//invocation
#define INVOKE_SHOUT "shout"
#define INVOKE_WHISPER "whisper"
#define INVOKE_EMOTE "emote"
#define INVOKE_NONE "none"

//upgrading
#define UPGRADE_SPEED "speed"
#define UPGRADE_POWER "power"
#define UPGRADE_TOTAL "total"

//casting costs
#define SPELL_RECHARGE "recharge"
#define SPELL_CHARGES "charges"
#define SPELL_HOLDVAR "holdervar"

//Voting-related
#define VOTE_PROCESS_ABORT 1
#define VOTE_PROCESS_COMPLETE 2
Expand Down
50 changes: 50 additions & 0 deletions code/__defines/magic.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Defines for dispell strengths
#define DISPELL_WEAK 1
#define DISPELL_MEDIUM 2
#define DISPELL_STRONG 3
#define DISPELL_UNSTOPPABLE 4

// All possible spell categories. Please follow them.
#define SPELL_CATEGORY_FIRE "Fire"
#define SPELL_CATEGORY_EXPLOSIVE "Explosive"
#define SPELL_CATEGORY_HEALING "Healing"
#define SPELL_CATEGORY_MOBILITY "Mobility"
#define SPELL_CATEGORY_PASSIVE "Passive"
#define SPELL_CATEGORY_ANTIMAGIC "Anti-magic"
#define SPELL_CATEGORY_FORBIDDEN "Forbidden arts"

// Spell flags
#define GHOSTCAST 0x1 //can a ghost cast it?
#define NEEDSCLOTHES 0x2 //does it need the wizard garb to cast? Nonwizard spells should not have this
#define NEEDSHUMAN 0x4 //does it require the caster to be human?
#define Z2NOCAST 0x8 //if this is added, the spell can't be cast at centcomm
#define NO_SOMATIC 0x10 //spell will go off if the person is incapacitated or stunned
#define IGNOREPREV 0x20 //if set, each new target does not overlap with the previous one
//The following flags only affect different types of spell, and therefore overlap
//Targeted spells
#define INCLUDEUSER 0x40 //does the spell include the caster in its target selection?
#define SELECTABLE 0x80 //can you select each target for the spell?
#define NOFACTION 0x1000 //Don't do the same as our faction
#define NONONFACTION 0x2000 //Don't do people other than our faction
//AOE spells
#define IGNOREDENSE 0x40 //are dense turfs ignored in selection?
#define IGNORESPACE 0x80 //are space turfs ignored in selection?
//End split flags
#define CONSTRUCT_CHECK 0x100 //used by construct spells - checks for nullrods
#define NO_BUTTON 0x200 //spell won't show up in the HUD with this

// Invocation
#define INVOKE_SHOUT "shout"
#define INVOKE_WHISPER "whisper"
#define INVOKE_EMOTE "emote"
#define INVOKE_NONE "none"

// Upgrading
#define UPGRADE_SPEED "speed"
#define UPGRADE_POWER "power"
#define UPGRADE_TOTAL "total"

// Casting costs
#define SPELL_RECHARGE "recharge"
#define SPELL_CHARGES "charges"
#define SPELL_HOLDVAR "holdervar"
11 changes: 11 additions & 0 deletions code/_global_vars/lists/misc.dm
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
GLOBAL_LIST_EMPTY(trusted_players) //CKeys of trusted players.

// A global list of all available spell categories
GLOBAL_LIST_INIT(spell_categories, list(
SPELL_CATEGORY_FIRE,
SPELL_CATEGORY_EXPLOSIVE,
SPELL_CATEGORY_HEALING,
SPELL_CATEGORY_MOBILITY,
SPELL_CATEGORY_PASSIVE,
SPELL_CATEGORY_ANTIMAGIC,
SPELL_CATEGORY_FORBIDDEN,
))
10 changes: 0 additions & 10 deletions code/_helpers/global_access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@
return global.appearance_manager;
if("area_repository")
return global.area_repository;
if("artefact_feedback")
return global.artefact_feedback;
if("ascii_esc")
return global.ascii_esc;
if("ascii_green")
Expand Down Expand Up @@ -759,8 +757,6 @@
return global.spacevines_spawned;
if("sparring_attack_cache")
return global.sparring_attack_cache;
if("spells")
return global.spells;
if("splatter_cache")
return global.splatter_cache;
if("sqladdress")
Expand Down Expand Up @@ -1190,8 +1186,6 @@
global.appearance_manager=newval;
if("area_repository")
global.area_repository=newval;
if("artefact_feedback")
global.artefact_feedback=newval;
if("ascii_esc")
global.ascii_esc=newval;
if("ascii_green")
Expand Down Expand Up @@ -1652,8 +1646,6 @@
global.spacevines_spawned=newval;
if("sparring_attack_cache")
global.sparring_attack_cache=newval;
if("spells")
global.spells=newval;
if("splatter_cache")
global.splatter_cache=newval;
if("sqladdress")
Expand Down Expand Up @@ -1934,7 +1926,6 @@
"antag_add_finished",
"appearance_manager",
"area_repository",
"artefact_feedback",
"ascii_esc",
"ascii_green",
"ascii_red",
Expand Down Expand Up @@ -2165,7 +2156,6 @@
"sounds_cache",
"spacevines_spawned",
"sparring_attack_cache",
"spells",
"splatter_cache",
"sqladdress",
"sqldb",
Expand Down
2 changes: 2 additions & 0 deletions code/_helpers/maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
/// Value or the nearest multiple of divisor in either direction
#define Roundm(value, divisor) round((value), (divisor))

#define ATAN2(x, y) ( !(x) && !(y) ? 0 : (y) >= 0 ? arccos((x) / sqrt((x)*(x) + (y)*(y))) : -arccos((x) / sqrt((x)*(x) + (y)*(y))) )

// min is inclusive, max is exclusive
/proc/Wrap(val, min, max)
var/d = max - min
Expand Down
Loading

0 comments on commit 721486e

Please sign in to comment.