Skip to content

Commit

Permalink
New spell: Lesser Beckoning (L3 Tloc)
Browse files Browse the repository at this point in the history
Beam-targeted spell that moves the target adjacent to the caster.
Won't move victims into instakill terrain (lava etc), but will
move them over such terrain. Can move monsters into traps. Range
starts at 2, and caps at 7 (LOS_RADIUS) at 50 power; if the effect
is too powerful, doubling the power cap to 100 might be one way to
adjust it. (Alternately, it could gain a second school;
tloc/earth?)

Intended to be a fun utility effect. It's currently in Party Tricks
and in Spatial Translocations, replacing Apportation in the latter;
that means that Warper no longer starts with a spell, but that's
probably OK.
  • Loading branch information
PleasingFungus committed Oct 1, 2016
1 parent a95302d commit fcbf923
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 1 deletion.
11 changes: 11 additions & 0 deletions crawl-ref/source/beam.cc
Expand Up @@ -219,6 +219,7 @@ static void _ench_animation(int flavour, const monster* mon, bool force)
case BEAM_BANISH:
case BEAM_BLINK:
case BEAM_BLINK_CLOSE:
case BEAM_BECKONING:
elem = ETC_WARP;
break;
case BEAM_MAGIC:
Expand Down Expand Up @@ -3594,6 +3595,10 @@ void bolt::affect_player_enchantment(bool resistible)
obvious_effect = true;
break;

case BEAM_BECKONING:
obvious_effect = beckon(you, *this);
break;

case BEAM_ENSLAVE:
mprf(MSGCH_WARN, "Your will is overpowered!");
confuse_player(5 + random2(3));
Expand Down Expand Up @@ -5144,6 +5149,7 @@ bool bolt::has_saving_throw() const
case BEAM_ENSLAVE_SOUL:
case BEAM_BLINK_CLOSE:
case BEAM_BLINK:
case BEAM_BECKONING:
case BEAM_MALIGN_OFFERING:
case BEAM_AGILITY:
case BEAM_RESISTANCE:
Expand Down Expand Up @@ -5359,6 +5365,10 @@ mon_resist_type bolt::apply_enchantment_to_monster(monster* mon)
blink_other_close(mon, source);
return MON_AFFECTED;

case BEAM_BECKONING:
obvious_effect = beckon(*mon, *this);
return obvious_effect ? MON_AFFECTED : MON_OTHER; // ?

case BEAM_POLYMORPH:
if (mon->polymorph(ench_power))
obvious_effect = true;
Expand Down Expand Up @@ -6535,6 +6545,7 @@ static string _beam_type_name(beam_type type)
case BEAM_DISINTEGRATION: return "disintegration";
case BEAM_BLINK: return "blink";
case BEAM_BLINK_CLOSE: return "blink close";
case BEAM_BECKONING: return "beckoning";
case BEAM_PETRIFY: return "petrify";
case BEAM_CORONA: return "backlight";
case BEAM_PORKALATOR: return "porkalator";
Expand Down
3 changes: 2 additions & 1 deletion crawl-ref/source/book-data.h
Expand Up @@ -65,9 +65,9 @@ static const vector<spell_type> spellbook_templates[] =
},

{ // Book of Spatial Translocations
SPELL_APPORTATION,
SPELL_BLINK,
SPELL_SHROUD_OF_GOLUBRIA,
SPELL_BECKONING,
SPELL_PORTAL_PROJECTILE,
SPELL_TELEPORT_OTHER,
SPELL_GOLUBRIAS_PASSAGE,
Expand Down Expand Up @@ -288,6 +288,7 @@ static const vector<spell_type> spellbook_templates[] =
{ // Book of Party Tricks
SPELL_SUMMON_BUTTERFLIES,
SPELL_APPORTATION,
SPELL_BECKONING,
SPELL_TUKIMAS_DANCE,
SPELL_INTOXICATE,
SPELL_INVISIBILITY
Expand Down
4 changes: 4 additions & 0 deletions crawl-ref/source/dat/descript/spells.txt
Expand Up @@ -802,6 +802,10 @@ Lehudib's Crystal Spear spell

Hurls a lethally sharp shard of crystal.
%%%%
Lesser Beckoning spell

Beckons the target forward, attempting to place them adjacent to the caster.
%%%%
Lightning Bolt spell

Fires a mighty bolt of lightning. It inflicts less damage than other similar
Expand Down
3 changes: 3 additions & 0 deletions crawl-ref/source/enum.h
Expand Up @@ -650,6 +650,7 @@ enum beam_type // bolt::flavour
BEAM_DISINTEGRATION,
BEAM_BLINK,
BEAM_BLINK_CLOSE,
BEAM_BECKONING,
BEAM_PETRIFY,
BEAM_CORONA,
BEAM_PORKALATOR,
Expand Down Expand Up @@ -4707,6 +4708,7 @@ enum spell_type : int
SPELL_RESONANCE_STRIKE,
SPELL_GHOSTLY_SACRIFICE,
SPELL_DREAM_DUST,
SPELL_BECKONING,
NUM_SPELLS
};

Expand Down Expand Up @@ -4887,6 +4889,7 @@ enum zap_type
ZAP_SAP_MAGIC,
ZAP_VIRULENCE,
ZAP_DRAIN_MAGIC,
ZAP_BECKONING,
NUM_ZAPS
};

Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/rltiles/dc-spells.txt
Expand Up @@ -139,6 +139,7 @@ spellforged_servitor SPELLFORGED_SERVITOR

%sdir gui/spells/translocation
apportation APPORTATION
beckoning BECKONING
blink BLINK
controlled_blink CONTROLLED_BLINK
disjunction DISJUNCTION
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions crawl-ref/source/spl-data.h
Expand Up @@ -3847,6 +3847,17 @@ static const struct spell_desc spelldata[] =
TILEG_ERROR,
},

{
SPELL_BECKONING, "Lesser Beckoning",
SPTYP_TRANSLOCATION,
SPFLAG_DIR_OR_TARGET | SPFLAG_NOT_SELF | SPFLAG_NEEDS_TRACER,
3,
50,
2, LOS_RADIUS,
2, 0,
TILEG_BECKONING,
},

{
SPELL_NO_SPELL, "nonexistent spell",
SPTYP_NONE,
Expand Down
60 changes: 60 additions & 0 deletions crawl-ref/source/spl-transloc.cc
Expand Up @@ -19,6 +19,7 @@
#include "delay.h"
#include "directn.h"
#include "dungeon.h"
#include "english.h"
#include "itemprop.h"
#include "items.h"
#include "libutil.h"
Expand All @@ -30,6 +31,7 @@
#include "mon-behv.h"
#include "mon-death.h"
#include "mon-place.h"
#include "mon-tentacle.h"
#include "mon-util.h"
#include "nearby-danger.h"
#include "orb.h"
Expand Down Expand Up @@ -1015,3 +1017,61 @@ spret_type cast_gravitas(int pow, const coord_def& where, bool fail)
fatal_attraction(where, &you, pow);
return SPRET_SUCCESS;
}

/**
* Where is the closest point along the given path to its source that the given
* actor can be moved to?
*
* @param beckoned The actor to be moved.
* @param path The path for the actor to be moved along
* @return The closest point for the actor to be moved to;
* guaranteed to be on the path or its original location.
*/
static coord_def _beckon_destination(const actor &beckoned, const bolt &path)
{
if (beckoned.is_stationary() // don't move statues, etc
|| mons_is_tentacle_or_tentacle_segment(beckoned.type)) // a mess...
{
return beckoned.pos();
}

for (coord_def pos : path.path_taken)
{
if (actor_at(pos) || !beckoned.is_habitable(pos))
continue; // actor could be caster, or a bush

return pos;
}

return beckoned.pos(); // failed to find any point along the path
}

/**
* Attempt to move the beckoned creature to the spot on the path closest to its
* beginning (that is, to the caster of the effect). Also handles some
* messaging.
*
* @param beckoned The creature being moved.
* @param path The path to move the creature along.
* @return Whether the beckoned creature actually moved.
*/
bool beckon(actor &beckoned, const bolt &path)
{
const coord_def dest = _beckon_destination(beckoned, path);
if (dest == beckoned.pos())
return false;

const coord_def old_pos = beckoned.pos();
if (!beckoned.move_to_pos(dest))
return false;

mprf("%s %s suddenly forward!",
beckoned.name(DESC_THE).c_str(),
beckoned.conj_verb("hurl").c_str());

beckoned.apply_location_effects(old_pos); // traps, etc.
if (beckoned.is_monster())
mons_relocated(beckoned.as_monster()); // cleanup tentacle segments

return true;
}
2 changes: 2 additions & 0 deletions crawl-ref/source/spl-transloc.h
Expand Up @@ -28,4 +28,6 @@ spret_type cast_dispersal(int pow, bool fail = false);
int gravitas_range(int pow, int strength = 1);
bool fatal_attraction(const coord_def& pos, const actor *agent, int pow);
spret_type cast_gravitas(int pow, const coord_def& where, bool fail);

bool beckon(actor &beckoned, const bolt &path);
#endif
1 change: 1 addition & 0 deletions crawl-ref/source/spl-zap.cc
Expand Up @@ -59,6 +59,7 @@ static pair<spell_type, zap_type> _spl_zaps[] =
{ SPELL_CRYSTAL_BOLT, ZAP_CRYSTAL_BOLT },
{ SPELL_TUKIMAS_DANCE, ZAP_TUKIMAS_DANCE },
{ SPELL_CORROSIVE_BOLT, ZAP_CORROSIVE_BOLT },
{ SPELL_BECKONING, ZAP_BECKONING },
{ SPELL_DEBUGGING_RAY, ZAP_DEBUGGING_RAY },

// monster-specific
Expand Down
18 changes: 18 additions & 0 deletions crawl-ref/source/zap-data.h
Expand Up @@ -1340,4 +1340,22 @@ _mon_hex_zap(ZAP_VIRULENCE, BEAM_VIRULENCE),
_mon_hex_zap(ZAP_SAP_MAGIC, BEAM_SAP_MAGIC),
_mon_hex_zap(ZAP_DRAIN_MAGIC, BEAM_DRAIN_MAGIC),

{
ZAP_BECKONING,
"beckoning",
200,
nullptr,
nullptr,
nullptr,
nullptr,
ETC_WARP,
true,
BEAM_BECKONING,
DCHAR_FIRED_ZAP,
false,
false,
false,
0
},

};

0 comments on commit fcbf923

Please sign in to comment.