Skip to content

Commit

Permalink
Merge pull request #34379 from KorGgenT/AEA_MAP
Browse files Browse the repository at this point in the history
AEA_MAP
  • Loading branch information
ZhilkinSerg authored Oct 2, 2019
2 parents 01c994f + ece2f34 commit 6363709
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions data/json/legacy_artifact_active.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,5 +354,17 @@
"message": "",
"min_range": 40,
"max_range": 40
},
{
"type": "SPELL",
"id": "AEA_MAP",
"effect": "map",
"name": "Artifact Map",
"description": "Reveals an area around you on the overmap",
"valid_targets": [ "self" ],
"min_aoe": 20,
"max_aoe": 20,
"message": "You have a vision of the surrounding area...",
"base_casting_time": 100
}
]
2 changes: 2 additions & 0 deletions doc/MAGIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Any aoe will manifest as a circular area centered on the target, and will only d
* "flashbang" - a flashbang effect is centered on the target, with poewr damage() and factor aoe()/10
* "map" - maps the overmap centered on the player out to a radius of aoe()
* "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
1 change: 1 addition & 0 deletions src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ void spell_type::load( JsonObject &jo, const std::string & )
{ "vomit", spell_effect::vomit },
{ "explosion", spell_effect::explosion },
{ "flashbang", spell_effect::flashbang },
{ "map", spell_effect::map },
{ "none", spell_effect::none }
};

Expand Down
1 change: 1 addition & 0 deletions src/magic.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ 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 map( const spell &sp, Creature &caster, const tripoint & );
void none( const spell &sp, Creature &, const tripoint &target );
} // namespace spell_effect

Expand Down
12 changes: 12 additions & 0 deletions src/magic_spell_effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "mapdata.h"
#include "messages.h"
#include "monster.h"
#include "overmapbuffer.h"
#include "player.h"
#include "projectile.h"
#include "type_id.h"
Expand Down Expand Up @@ -723,3 +724,14 @@ void spell_effect::flashbang( const spell &sp, Creature &caster, const tripoint
explosion_handler::flashbang( target, caster.is_avatar() &&
!sp.is_valid_target( valid_target::target_self ) );
}

void spell_effect::map( const spell &sp, Creature &caster, const tripoint & )
{
const avatar *you = caster.as_avatar();
if( !you ) {
// revealing the map only makes sense for the avatar
return;
}
const tripoint center = you->global_omt_location();
overmap_buffer.reveal( center.xy(), sp.aoe(), center.z );
}

0 comments on commit 6363709

Please sign in to comment.