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

[Magiclysm] Fix npcs teaching you dragon breath #47581

Merged
merged 1 commit into from
Feb 20, 2021
Merged
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
4 changes: 2 additions & 2 deletions data/mods/Magiclysm/Spells/attunements/Artificer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"name": "Spy Wasp",
"description": "Sends out a partly magical, partly electronic spy drone shaped like a wasp that reveals terrain in a line in front of you. The wasp can travel through walls.",
"valid_targets": [ "hostile", "ground" ],
"flags": [ "CONCENTRATE", "IGNORE_WALLS", "NO_LEGS", "SILENT" ],
"flags": [ "CONCENTRATE", "IGNORE_WALLS", "NO_LEGS", "SILENT", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"shape": "line",
"min_range": 24,
Expand Down Expand Up @@ -90,7 +90,7 @@
"name": "Artificer's Toolkit",
"description": "Artificers have a special pocket dimension with a magical tool that can cover a wide variety of tasks. It is only a matter of temporarily summoning the item for use.",
"valid_targets": [ "none" ],
"flags": [ "CONCENTRATE", "NO_LEGS" ],
"flags": [ "CONCENTRATE", "NO_LEGS", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "spawn_item",
"shape": "blast",
"effect_str": "artificer_toolkit",
Expand Down
3 changes: 2 additions & 1 deletion data/mods/Magiclysm/Spells/attunements/Biotek.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"name": "Nitro Boost",
"description": "You overclock your flesh and bionics, charging so fast the friction can ignite the air, to wind up for a skull-cracking punch.",
"valid_targets": [ "hostile", "ground" ],
"flags": [ "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "dash",
"effect_str": "downed",
"shape": "cone",
Expand Down Expand Up @@ -45,7 +46,7 @@
"energy_increment": -20,
"final_energy_cost": 100,
"components": "jury_rig",
"flags": [ "SOMATIC", "VERBAL", "NO_LEGS", "CONCENTRATE" ],
"flags": [ "SOMATIC", "VERBAL", "NO_LEGS", "CONCENTRATE", "MUST_HAVE_CLASS_TO_LEARN" ],
"spell_class": "BIOTEK",
"difficulty": 2,
"energy_source": "BIONIC"
Expand Down
4 changes: 2 additions & 2 deletions data/mods/Magiclysm/Spells/attunements/Blood_Mage.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Greater Banishment",
"description": "A more advanced version of Banishment, which is a ritual spell that attempts to banish a monster. Being closely related to blood magic, the Blood Mage is much more specialized to use a spell like this.",
"valid_targets": [ "hostile" ],
"flags": [ "SOMATIC", "VERBAL" ],
"flags": [ "SOMATIC", "VERBAL", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "banishment",
"shape": "blast",
"min_damage": 120,
Expand Down Expand Up @@ -56,7 +56,7 @@
"name": "Demonic Possession",
"description": "You allow a demon to possess your body for a short time, giving you great combat abilities. You still retain control, though lose your spellcasting abilities temporariliy.",
"valid_targets": [ "none" ],
"flags": [ "SOMATIC", "NO_LEGS" ],
"flags": [ "SOMATIC", "NO_LEGS", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "spawn_item",
"shape": "blast",
"effect_str": "demon_possession_aura",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/Spells/attunements/Boreal_Mage.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Auroral Wave",
"description": "A rippling wave of luminous energy spreads from your hands, a beautiful torrent of magnetic force and chill wind.",
"valid_targets": [ "hostile", "ground" ],
"flags": [ "SOMATIC" ],
"flags": [ "SOMATIC", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"shape": "cone",
"extra_effects": [ { "id": "auroral_wave_cold" } ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"name": "Immolate",
"description": "A purifying blast of raw elemental heat wipes the slate clean, searing the Earth back to her most original state: a barren ball of burning rock.",
"valid_targets": [ "ally", "hostile", "ground" ],
"flags": [ "SOMATIC", "VERBAL", "NO_LEGS", "LOUD", "CONCENTRATE", "IGNITE_FLAMMABLE" ],
"flags": [ "SOMATIC", "VERBAL", "NO_LEGS", "LOUD", "CONCENTRATE", "IGNITE_FLAMMABLE", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"shape": "blast",
"extra_effects": [ { "id": "immolate_transform" }, { "id": "immolate_push" } ],
Expand Down
6 changes: 3 additions & 3 deletions data/mods/Magiclysm/Spells/attunements/Earth_Elemental.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"name": "Quake",
"description": "Cause a localized earthquake, knocking down enemies and overturning the earth.",
"valid_targets": [ "hostile", "ground" ],
"flags": [ "LOUD", "NO_PROJECTILE" ],
"flags": [ "LOUD", "NO_PROJECTILE", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"shape": "blast",
"effect_str": "downed",
Expand Down Expand Up @@ -38,7 +38,7 @@
"name": "Quake Transform",
"description": "causes rubble to be spawned occasionally",
"valid_targets": [ "hostile", "ground" ],
"flags": [ "SILENT" ],
"flags": [ "SILENT", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "ter_transform",
"effect_str": "quake_transform",
"shape": "blast",
Expand All @@ -55,7 +55,7 @@
"name": "Rock Blast",
"description": "Fire three large rocks at an enemy, causing blunt damage and knocking it back.",
"valid_targets": [ "hostile" ],
"flags": [ "SOMATIC", "NO_LEGS" ],
"flags": [ "SOMATIC", "NO_LEGS", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"shape": "blast",
"max_level": 35,
Expand Down
4 changes: 2 additions & 2 deletions data/mods/Magiclysm/Spells/attunements/Fire_Elemental.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Flareup",
"description": "You channel heat through your hands to severely burn a target you touch.",
"valid_targets": [ "hostile" ],
"flags": [ "CONCENTRATE", "SOMATIC", "NO_PROJECTILE" ],
"flags": [ "CONCENTRATE", "SOMATIC", "NO_PROJECTILE", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"shape": "blast",
"damage_type": "heat",
Expand All @@ -30,7 +30,7 @@
"name": "Flarewhip",
"description": "You conjure a whip made of solid flame.",
"valid_targets": [ "none" ],
"flags": [ "SOMATIC" ],
"flags": [ "SOMATIC", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "spawn_item",
"effect_str": "flarewhip",
"shape": "blast",
Expand Down
4 changes: 2 additions & 2 deletions data/mods/Magiclysm/Spells/attunements/Force_Mage.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Force Blade",
"description": "You shoot a blade of concentrated force in a straight line, cutting everything in its path.",
"valid_targets": [ "hostile", "ground", "ally" ],
"flags": [ "SOMATIC", "NO_LEGS" ],
"flags": [ "SOMATIC", "NO_LEGS", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"shape": "line",
"spell_class": "FORCE_MAGE",
Expand Down Expand Up @@ -60,7 +60,7 @@
"name": "Force Shield",
"description": "Adds a shield of pure force that protects your body and your clothing from attacks.",
"valid_targets": [ "none" ],
"flags": [ "VERBAL", "CONCENTRATE" ],
"flags": [ "VERBAL", "CONCENTRATE", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "spawn_item",
"effect_str": "force_magical_armor",
"shape": "blast",
Expand Down
4 changes: 2 additions & 2 deletions data/mods/Magiclysm/Spells/attunements/Glacier_Mage.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"shape": "cone",
"valid_targets": [ "hostile", "ground" ],
"extra_effects": [ { "id": "ice_clave_blunt" } ],
"flags": [ "LOUD", "NO_HANDS" ],
"flags": [ "LOUD", "NO_HANDS", "MUST_HAVE_CLASS_TO_LEARN" ],
"min_damage": 30,
"max_damage": 100,
"damage_increment": 2.0,
Expand Down Expand Up @@ -56,7 +56,7 @@
"effect": "attack",
"shape": "line",
"valid_targets": [ "hostile", "ground" ],
"flags": [ "SOMATIC", "NO_LEGS", "LOUD" ],
"flags": [ "SOMATIC", "NO_LEGS", "LOUD", "MUST_HAVE_CLASS_TO_LEARN" ],
"extra_effects": [ { "id": "frozen_winds_push" } ],
"max_level": 35,
"min_damage": 25,
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/Spells/attunements/Golemancer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"effect": "directed_push",
"shape": "blast",
"valid_targets": [ "hostile" ],
"flags": [ "LOUD", "VERBAL", "SOMATIC" ],
"flags": [ "LOUD", "VERBAL", "SOMATIC", "MUST_HAVE_CLASS_TO_LEARN" ],
"spell_class": "GOLEMANCER",
"min_damage": 5,
"max_damage": 16,
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/Spells/attunements/Ice_Elemental.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Subzero Talons",
"description": "Your fingers stiffen as condensation freezes into claws, intensifying your naturally cold touch and protecting your hands from damage.",
"valid_targets": [ "none" ],
"flags": [ "NO_LEGS", "CONCENTRATE" ],
"flags": [ "NO_LEGS", "CONCENTRATE", "MUST_HAVE_CLASS_TO_LEARN" ],
"min_damage": 1,
"max_damage": 1,
"effect": "spawn_item",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/Spells/attunements/Illusionist.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Spear of Light",
"description": "Shoot directed light from your fingertips that is so bright you can see through the skin of the targets for an instant.",
"valid_targets": [ "hostile" ],
"flags": [ "SOMATIC", "VERBAL", "SILENT" ],
"flags": [ "SOMATIC", "VERBAL", "SILENT", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"effect_str": "blind",
"shape": "line",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/Spells/attunements/Magnetism_Mage.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
"type": "SPELL",
"name": "Railgun",
"description": "Magnetize a bullet, and fire it at supersonic speeds by applying an opposite magnetic force to the bullet. Leaves a trail of sparks",
"flags": [ "LOUD", "SOMATIC", "NO_LEGS" ],
"flags": [ "LOUD", "SOMATIC", "NO_LEGS", "MUST_HAVE_CLASS_TO_LEARN" ],
"valid_targets": [ "hostile" ],
"spell_class": "MAGNETISM_MAGE",
"energy_source": "MANA",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/Spells/attunements/Overclocker.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"effect_str": "neuro_boost",
"shape": "blast",
"valid_targets": [ "ally", "hostile", "self" ],
"flags": [ "SOMATIC", "CONCENTRATE", "NO_PROJECTILE" ],
"flags": [ "SOMATIC", "CONCENTRATE", "NO_PROJECTILE", "MUST_HAVE_CLASS_TO_LEARN" ],
"max_level": 35,
"min_damage": 0,
"max_damage": 35,
Expand Down
6 changes: 3 additions & 3 deletions data/mods/Magiclysm/Spells/attunements/Radiation_Mage.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Shortwave",
"description": "Cook nearby monsters (and yourself to an extent)",
"valid_targets": [ "hostile", "ground", "self" ],
"flags": [ "SOMATIC" ],
"flags": [ "SOMATIC", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"shape": "blast",
"damage_type": "pure",
Expand All @@ -29,7 +29,7 @@
"name": "Shortwave 2",
"description": "Cook nearby monsters (and yourself to an extent)",
"valid_targets": [ "hostile" ],
"flags": [ "SOMATIC" ],
"flags": [ "SOMATIC", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"shape": "blast",
"damage_type": "heat",
Expand All @@ -48,7 +48,7 @@
"name": "Gamma Burst",
"description": "Cause cell damage to everything in a wide area. Fast to cast, but does damage slowly.",
"valid_targets": [ "hostile", "ally" ],
"flags": [ "NO_LEGS", "NO_HANDS" ],
"flags": [ "NO_LEGS", "NO_HANDS", "MUST_HAVE_CLASS_TO_LEARN" ],
"shape": "blast",
"effect": "attack",
"damage_type": "pure",
Expand Down
4 changes: 2 additions & 2 deletions data/mods/Magiclysm/Spells/attunements/Soulfire.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Burn at Both Ends",
"description": "A candle burns the most brightly at both ends, and yet it burns twice as fast.",
"valid_targets": [ "hostile" ],
"flags": [ "CONCENTRATE", "SOMATIC", "NO_PROJECTILE" ],
"flags": [ "CONCENTRATE", "SOMATIC", "NO_PROJECTILE", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"shape": "blast",
"damage_type": "heat",
Expand Down Expand Up @@ -52,7 +52,7 @@
"name": "Soul Afterburner",
"description": "You burn a small portion of your soul to gain a large burst of speed.",
"valid_targets": [ "self" ],
"flags": [ "VERBAL", "SILENT" ],
"flags": [ "VERBAL", "SILENT", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "mod_moves",
"shape": "blast",
"min_damage": 750,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"base_energy_cost": 500,
"base_casting_time": 100,
"difficulty": 4,
"flags": [ "LOUD", "SOMATIC", "NO_LEGS" ],
"flags": [ "LOUD", "SOMATIC", "NO_LEGS", "MUST_HAVE_CLASS_TO_LEARN" ],
"sound_description": "a crackle",
"valid_targets": [ "hostile" ],
"extra_effects": [ { "id": "storm_chain_1" }, { "id": "storm_chain_1" } ]
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/Spells/attunements/Sun_Mage.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Solar Beam",
"description": "Fire a blast of sunlight in a wide beam, blinding everything in its path and leaving it bright enough for you to see for a few seconds.",
"valid_targets": [ "hostile", "ground" ],
"flags": [ "SOMATIC" ],
"flags": [ "SOMATIC", "MUST_HAVE_CLASS_TO_LEARN" ],
"effect": "attack",
"shape": "line",
"effect_str": "blind",
Expand Down
4 changes: 2 additions & 2 deletions data/mods/Magiclysm/Spells/attunements/Tundra_Mage.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"base_energy_cost": 100,
"base_casting_time": 33,
"difficulty": 7,
"flags": [ "NO_LEGS" ],
"flags": [ "NO_LEGS", "MUST_HAVE_CLASS_TO_LEARN" ],
"sound_description": "crack",
"valid_targets": [ "hostile" ],
"extra_effects": [ { "id": "cold_snap_freeze" } ]
Expand Down Expand Up @@ -61,7 +61,7 @@
"range_increment": 0.2,
"min_aoe": 2,
"max_aoe": 2,
"flags": [ "SOMATIC", "VERBAL", "CONCENTRATE" ],
"flags": [ "SOMATIC", "VERBAL", "CONCENTRATE", "MUST_HAVE_CLASS_TO_LEARN" ],
"min_duration": 36000,
"max_duration": 180000,
"duration_increment": 5000
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/Spells/attunements/Vulcanist.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"base_casting_time": 350,
"base_energy_cost": 400,
"energy_source": "MANA",
"flags": [ "VERBAL", "SOMATIC", "LOUD" ],
"flags": [ "VERBAL", "SOMATIC", "LOUD", "MUST_HAVE_CLASS_TO_LEARN" ],
"extra_effects": [ { "id": "lava_bomb_shrapnel" }, { "id": "lava_bomb_heat" }, { "id": "lava_bomb_ter" } ],
"spell_class": "VULCANIST"
}
Expand Down
1 change: 1 addition & 0 deletions data/mods/Magiclysm/Spells/attunements/Wither_Mage.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"effect": "attack",
"shape": "blast",
"valid_targets": [ "hostile" ],
"flags": [ "MUST_HAVE_CLASS_TO_LEARN" ],
"min_damage": 35,
"max_damage": 490,
"damage_increment": 13,
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/Spells/dragonbreath.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"max_field_intensity": 4,
"field_chance": 2,
"field_intensity_increment": 0.1,
"flags": [ "VERBAL", "NO_HANDS", "NO_LEGS" ]
"flags": [ "VERBAL", "NO_HANDS", "NO_LEGS", "MUST_HAVE_CLASS_TO_LEARN" ]
}
]
4 changes: 2 additions & 2 deletions data/mods/Magiclysm/Spells/manatouched.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Crystallizes mana into solid form. Your physiological changes have made this spell much more efficient and easier to cast.",
"valid_targets": [ "self" ],
"spell_class": "MANA_CRYST_MANA",
"flags": [ "PERMANENT", "NO_LEGS", "CONCENTRATE", "NO_HANDS" ],
"flags": [ "PERMANENT", "NO_LEGS", "CONCENTRATE", "NO_HANDS", "MUST_HAVE_CLASS_TO_LEARN" ],
"max_level": 5,
"difficulty": 3,
"min_damage": 4,
Expand Down Expand Up @@ -44,7 +44,7 @@
"final_casting_time": 85,
"damage_type": "pure",
"sound_description": "a zing",
"flags": [ "RANDOM_TARGET", "SOMATIC", "NO_LEGS" ],
"flags": [ "RANDOM_TARGET", "SOMATIC", "NO_LEGS", "MUST_HAVE_CLASS_TO_LEARN" ],
"extra_effects": [ { "id": "magic_missile" }, { "id": "magic_missile" }, { "id": "magic_missile" }, { "id": "magic_missile" } ]
}
]
7 changes: 6 additions & 1 deletion src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ std::string enum_to_string<spell_flag>( spell_flag data )
case spell_flag::IGNITE_FLAMMABLE: return "IGNITE_FLAMMABLE";
case spell_flag::NO_FAIL: return "NO_FAIL";
case spell_flag::WONDER: return "WONDER";
case spell_flag::MUST_HAVE_CLASS_TO_LEARN: return "MUST_HAVE_CLASS_TO_LEARN";
case spell_flag::LAST: break;
}
debugmsg( "Invalid spell_flag" );
Expand Down Expand Up @@ -1575,7 +1576,11 @@ bool known_magic::can_learn_spell( const Character &guy, const spell_id &sp ) co
if( sp_t.spell_class == trait_NONE ) {
return true;
}
return !guy.has_opposite_trait( sp_t.spell_class );
if( sp_t.spell_tags[spell_flag::MUST_HAVE_CLASS_TO_LEARN] ) {
return guy.has_trait( sp_t.spell_class );
} else {
return !guy.has_opposite_trait( sp_t.spell_class );
}
}

spell &known_magic::get_spell( const spell_id &sp )
Expand Down
1 change: 1 addition & 0 deletions src/magic.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ enum class spell_flag : int {
WITH_CONTAINER, // items spawned with container
SPAWN_GROUP, // spawn or summon from an item or monster group, instead of individual item/monster ID
IGNITE_FLAMMABLE, // if spell effect area has any thing flammable, a fire will be produced
MUST_HAVE_CLASS_TO_LEARN, // you can't learn the spell unless you already have the class.
LAST
};

Expand Down