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

AEA_FLASH and AEA_FIREBALL #34304

Merged
merged 2 commits into from
Sep 29, 2019
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
28 changes: 28 additions & 0 deletions data/json/legacy_artifact_active.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,5 +326,33 @@
"min_duration": 30000,
"max_duration": 30000,
"message": "The sky starts to dim."
},
{
"type": "SPELL",
"id": "AEA_FIREBALL",
"name": "Artifact Fireball",
"description": "Causes an explosion at the target",
"valid_targets": [ "hostile", "ground", "ally" ],
"effect": "explosion",
"base_casting_time": 100,
"min_damage": 180,
"max_damage": 180,
"min_aoe": 5,
"max_aoe": 5,
"message": "",
"min_range": 40,
"max_range": 40
},
{
"type": "SPELL",
"id": "AEA_FLASH",
"name": "Artifact Flash",
"description": "Causes a flashbang at the target",
"valid_targets": [ "hostile", "ground", "self" ],
"effect": "flashbang",
"base_casting_time": 100,
"message": "",
"min_range": 40,
"max_range": 40
}
]
4 changes: 4 additions & 0 deletions doc/MAGIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ Any aoe will manifest as a circular area centered on the target, and will only d

* "timed_event" - adds a timed event to the player only. valid timed events: "help", "wanted", "robot_attack", "spawn_wyrms", "amigara", "roots_die", "temple_open", "temple_flood", "temple_spawn", "dim", "artifact_light" NOTE: This was added only for artifact active effects. support is limited, use at your own risk.

* "explosion" - an explosion is centered on the target, with power damage() and factor aoe()/10

* "flashbang" - a flashbang effect is centered on the target, with poewr damage() and factor aoe()/10

* "WONDER" - Unlike the above, this is not an "effect" but a "flag". This alters the behavior of the parent spell drastically: The spell itself doesn't cast, but its damage and range information is used in order to cast the extra_effects. N of the extra_effects will be chosen at random to be cast, where N is the current damage of the spell (stacks with RANDOM_DAMAGE flag) and the message of the spell cast by this spell will also be displayed. If this spell's message is not wanted to be displayed, make sure the message is an empty string.

##### For Spells that have an attack type, these are the available damage types:
Expand Down
2 changes: 2 additions & 0 deletions src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ void spell_type::load( JsonObject &jo, const std::string & )
{ "timed_event", spell_effect::timed_event },
{ "ter_transform", spell_effect::transform_blast },
{ "vomit", spell_effect::vomit },
{ "explosion", spell_effect::explosion },
{ "flashbang", spell_effect::flashbang },
{ "none", spell_effect::none }
};

Expand Down
2 changes: 2 additions & 0 deletions src/magic.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ void translocate( const spell &sp, Creature &caster, const tripoint &target );
void timed_event( const spell &sp, Creature &caster, const tripoint & );
void transform_blast( const spell &sp, Creature &caster, const tripoint &target );
void vomit( const spell &sp, Creature &caster, const tripoint &target );
void explosion( const spell &sp, Creature &, const tripoint &target );
void flashbang( const spell &sp, Creature &caster, const tripoint &target );
void none( const spell &sp, Creature &, const tripoint &target );
} // namespace spell_effect

Expand Down
11 changes: 11 additions & 0 deletions src/magic_spell_effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,3 +711,14 @@ void spell_effect::vomit( const spell &sp, Creature &caster, const tripoint &tar
ch->vomit();
}
}

void spell_effect::explosion( const spell &sp, Creature &, const tripoint &target )
{
explosion_handler::explosion( target, sp.damage(), sp.aoe() / 10.0, true );
}

void spell_effect::flashbang( const spell &sp, Creature &caster, const tripoint &target )
{
explosion_handler::flashbang( target, caster.is_avatar() &&
!sp.is_valid_target( valid_target::target_self ) );
}