Skip to content

Commit

Permalink
Remove jump-attack
Browse files Browse the repository at this point in the history
The ability never worked particularly well in its original form. Its
original intent was to combine attacking and translocation, but
because it ended up being a low-level ability, the attack become only
a tool to ensure the repositioning wasn't brokenly powerful rather
than a meaningful thing by itself. This was particularly true for
stabbing, which had to be disabled in jump-attack so that it didn't
break stealth. Boots of jumping never saw much use, and while there
are a few fans of felid jumping, that species already has tremendously
good positioning ability.

The shadow-step ability with Dithmenos uses the core jump-attack
targeting code and is similar to jump-attack in many ways. So fans of
jump-attack can worship Dith to get an ability that works better in
general because of shadow-step's very specific (and non-annoying)
targeting restrictions, its better range, and its not having awkward
compromises from trying to combine attack with movement on a ability
requiring no investment.

Despite the shared code with shadow-step, a lot of the code most in
need of refactoring was simply removed, including the interactions
with melee-attack. I enjoyed coding jump-attack back when I was
learning the codebase, especially finally figuring out the difficult
direction UI code. But now that the feature has evolved into something
better, I'm happy to see all this code and bad gameplay go the way of
item destruction. rip in peace.
  • Loading branch information
gammafunk committed Oct 10, 2014
1 parent b91e0ce commit 3cebfc1
Show file tree
Hide file tree
Showing 37 changed files with 109 additions and 619 deletions.
81 changes: 0 additions & 81 deletions crawl-ref/source/ability.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ static void _pay_ability_costs(const ability_def& abil, int zpcost);
static int _scale_piety_cost(ability_type abil, int original_cost);
static string _zd_mons_description_for_ability(const ability_def &abil);
static monster_type _monster_for_ability(const ability_def& abil);
static spret_type _jump_player(int jump_range, int exh_red, bool fail);

/**
* This all needs to be split into data/util/show files
Expand Down Expand Up @@ -244,7 +243,6 @@ static const ability_def Ability_List[] =

{ ABIL_FLY, "Fly", 3, 0, 100, 0, 0, ABFLAG_NONE},
{ ABIL_STOP_FLYING, "Stop Flying", 0, 0, 0, 0, 0, ABFLAG_NONE},
{ ABIL_JUMP, "Jump Attack", 0, 0, 125, 0, 0, ABFLAG_EXHAUSTION},
{ ABIL_HELLFIRE, "Hellfire", 0, 150, 200, 0, 0, ABFLAG_NONE},

{ ABIL_DELAYED_FIREBALL, "Release Delayed Fireball",
Expand Down Expand Up @@ -275,7 +273,6 @@ static const ability_def Ability_List[] =
{ ABIL_EVOKE_TURN_INVISIBLE, "Evoke Invisibility",
2, 0, 250, 0, 0, ABFLAG_NONE},
{ ABIL_EVOKE_TURN_VISIBLE, "Turn Visible", 0, 0, 0, 0, 0, ABFLAG_NONE},
{ ABIL_EVOKE_JUMP, "Evoke Jump Attack", 2, 0, 125, 0, 0, ABFLAG_EXHAUSTION},
{ ABIL_EVOKE_FLIGHT, "Evoke Flight", 1, 0, 100, 0, 0, ABFLAG_NONE},
{ ABIL_EVOKE_FOG, "Evoke Fog", 2, 0, 250, 0, 0, ABFLAG_NONE},
{ ABIL_EVOKE_TELEPORT_CONTROL, "Evoke Teleport Control", 4, 0, 200, 0, 0, ABFLAG_NONE},
Expand Down Expand Up @@ -1068,10 +1065,6 @@ talent get_talent(ability_type ability, bool check_confused)
failure -= 20;
break;

case ABIL_JUMP:
failure = 25 - you.experience_level;
break;

case ABIL_FLY:
failure = 42 - (3 * you.experience_level);
break;
Expand Down Expand Up @@ -1126,9 +1119,6 @@ talent get_talent(ability_type ability, bool check_confused)
case ABIL_EVOKE_BLINK:
failure = 40 - you.skill(SK_EVOCATIONS, 2);
break;
case ABIL_EVOKE_JUMP:
failure = 30 - you.skill(SK_EVOCATIONS, 2);
break;
case ABIL_EVOKE_BERSERK:
case ABIL_EVOKE_FOG:
case ABIL_EVOKE_TELEPORT_CONTROL:
Expand Down Expand Up @@ -1814,13 +1804,6 @@ bool activate_talent(const talent& tal)
return false;
}

if ((tal.which == ABIL_EVOKE_JUMP || tal.which == ABIL_JUMP)
&& !you.can_jump())
{
crawl_state.zero_turns_taken();
return false;
}

if ((tal.which == ABIL_EVOKE_FLIGHT || tal.which == ABIL_TRAN_BAT || tal.which == ABIL_FLY)
&& !flight_allowed())
{
Expand Down Expand Up @@ -2148,10 +2131,6 @@ static spret_type _do_ability(const ability_def& abil, bool fail)
break;
}

case ABIL_JUMP:
return _jump_player(player_mutation_level(MUT_JUMP) + 2,
you.experience_level, fail);

case ABIL_RECHARGING:
fail_check();
if (recharge_wand() <= 0)
Expand Down Expand Up @@ -2453,8 +2432,6 @@ static spret_type _do_ability(const ability_def& abil, bool fail)
else
fly_player(you.skill(SK_EVOCATIONS, 2) + 30);
break;
case ABIL_EVOKE_JUMP:
return _jump_player(4, you.skill(SK_EVOCATIONS, 1), fail);
case ABIL_EVOKE_FOG: // cloak of the Thief
fail_check();
mpr("With a swish of your cloak, you release a cloud of fog.");
Expand Down Expand Up @@ -3626,9 +3603,6 @@ vector<talent> your_talents(bool check_confused, bool include_unusable)
}
}

if (player_mutation_level(MUT_JUMP))
_add_talent(talents, ABIL_JUMP, check_confused);

// Spit Poison. Nagas can upgrade to Breathe Poison.
if (you.species == SP_NAGA)
{
Expand Down Expand Up @@ -3782,9 +3756,6 @@ vector<talent> your_talents(bool check_confused, bool include_unusable)
}
}

if (you.evokable_jump() && !player_mutation_level(MUT_NO_ARTIFICE))
_add_talent(talents, ABIL_EVOKE_JUMP, check_confused);

if (you.wearing(EQ_RINGS, RING_TELEPORTATION)
&& !player_mutation_level(MUT_NO_ARTIFICE)
&& !crawl_state.game_is_sprint())
Expand Down Expand Up @@ -4103,55 +4074,3 @@ int scaling_cost::cost(int max) const
{
return (value < 0) ? (-value) : ((value * max + 500) / 1000);
}

/**
* Attempt to let the player perform a jump attack.
*
* @param jump_range The max range of the jump, as a radius.
* @param exh_red A factor that decreases jump exhaustion duration.
* @param fail Standard ability failure param, for fail_check().
* @return Whether the jump succeeded, failed, or was aborted.
* May sometimes return 'failed' when it was actually aborted, thanks to
* fight_jump(). TODO: refactor these methods together
*/
spret_type _jump_player(int jump_range, int exh_red, bool fail)
{
coord_def landing;
direction_chooser_args args;
targetter_jump tgt(&you, dist_range(jump_range));
dist jdirect;

args.restricts = DIR_JUMP;
args.mode = TARG_HOSTILE;
args.just_looking = false;
args.needs_path = true;
args.may_target_monster = true;
args.may_target_self = false;
args.target_prefix = NULL;
args.top_prompt = "Aiming: <white>Jump Attack</white>";
args.behaviour = NULL;
args.cancel_at_self = true;
args.hitfunc = &tgt;
args.range = jump_range;
direction(jdirect, args);
if (!jdirect.isValid)
{
// Check for user cancel.
canned_msg(MSG_OK);
return SPRET_ABORT;
}

fail_check();

if (!fight_jump(&you, actor_at(jdirect.target), jdirect.target,
tgt.landing_site, tgt.additional_sites,
tgt.jump_is_blocked))
{
you.turn_is_over = false;
return SPRET_ABORT;
}

you.increase_duration(DUR_EXHAUSTED, 3 + random2(10)
+ random2(30 - exh_red));
return SPRET_SUCCESS;
}
5 changes: 0 additions & 5 deletions crawl-ref/source/actor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,6 @@ int actor::evokable_flight(bool calc_unid) const
+ scan_artefacts(ARTP_FLY, calc_unid);
}

int actor::evokable_jump(bool calc_unid) const
{
return wearing_ego(EQ_ALL_ARMOUR, SPARM_JUMPING, calc_unid);
}

int actor::spirit_shield(bool calc_unid, bool items) const
{
int ss = 0;
Expand Down
2 changes: 0 additions & 2 deletions crawl-ref/source/actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ class actor
virtual bool invisible() const = 0;
virtual bool nightvision() const = 0;
virtual reach_type reach_range() const = 0;
virtual bool can_jump() const = 0;

// Would looker be able to see the actor when in LOS?
virtual bool visible_to(const actor *looker) const = 0;
Expand Down Expand Up @@ -328,7 +327,6 @@ class actor

// Return an int so we know whether an item is the sole source.
virtual int evokable_flight(bool calc_unid = true) const;
virtual int evokable_jump(bool calc_unid = true) const;
virtual int spirit_shield(bool calc_unid = true, bool items = true) const;

virtual flight_type flight_mode() const = 0;
Expand Down
16 changes: 0 additions & 16 deletions crawl-ref/source/dat/descript/ability.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ Start flying. During flight you can safely cross water and similar obstacles.
Be warned, though, that flight may time out at inopportune moments and cause
you to fall to your death.
%%%%
Jump Attack ability

Leap at a nearby enemy and perform a melee attack, landing somewhere adjacent
to the target. You cannot jump over flying enemies and can only leap giant
enemies submerged in lava or deep water. Standing or swimming in water, lava,
or liquefied ground will also prevent you from using this ability. Felids are
natural jumpers and will become more skilled at pouncing upon reaching
experience levels 6 and 12.
%%%%
Hellfire ability

Blast your enemies with hellfire. This ball of unholy flames explodes on
Expand Down Expand Up @@ -157,13 +148,6 @@ Evoke Flight ability

<Fly ability>
%%%%
Evoke Jump Attack ability

Leap at a nearby enemy and perform a melee attack, landing somewhere adjacent
to the target. You cannot jump over flying enemies and can only leap giant
enemies submerged in lava or deep water. Standing or swimming in water, lava,
or liquefied ground will also prevent you from using this ability.
%%%%
Stop Flying ability

Stop flying.
Expand Down
15 changes: 0 additions & 15 deletions crawl-ref/source/dat/descript/da/ability.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ Begynd at flyve. Mens du flyver kan du trygt krydse vand og lignende
forhindringer. Men vær dog opmærksom på, at evnen til at flyve kan udløbe på
uheldige tidspunkter og lade dig styrte i døden.
%%%%
Jump Attack ability

Du springer efter en fjende, udfører et nærkampsangreb og lander i nærheden af
målet. Du kan ikke hoppe over flyvende fjender, og du kan kun hoppe over kæmpe
fjender, der er nedsunket i lava eller dybt vand. Du kan heller ikke bruge
denne evne, hvis du står eller svømmer i vand, lava eller flydende jord. Katte
er naturlige springere og bliver endnu bedre, når de når niveau 6 og 12.
%%%%
Hellfire ability

Hærger dine fjender med helvedesild.
Expand Down Expand Up @@ -147,13 +139,6 @@ Turn Visible ability

Bliv synlig igen.
%%%%
Evoke Jump Attack ability

Du springer efter en fjende, udfører et nærkampsangreb og lander i nærheden af
målet. Du kan ikke hoppe over flyvende fjender, og du kan kun hoppe over kæmpe
fjender, der er nedsunket i lava eller dybt vand. Du kan heller ikke bruge
denne evne, hvis du står eller svømmer i vand, lava eller flydende jord.
%%%%
Stop Flying ability

Hold op med at flyve.
Expand Down
19 changes: 0 additions & 19 deletions crawl-ref/source/dat/descript/fr/ability.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ Commencer à voler. En vol, vous pouvez traverser en toute sécurité les eaux
profondes et les obstacles similaires. Soyez conscient que le vol peut
s'achever à un moment inopportun et vous faire chuter vers votre mort.
%%%%
Jump Attack ability

Un talent qui utilise l'énergie cinétique d'une créature pour déclencher une
attaque sautée très rapide, qui vous fait atterrir à proximité en toute
sécurité. Vous ne pouvez pas sauter sur les ennemis volants et ne pouvez sauter
sur des ennemis géants que s'ils sont plongés dans la lave ou de l'eau
profonde. Être dans l'eau profonde, la lave, ou sur un sol liquéfié vous
empêcher également d'utiliser ce talent. Les Felids sont des sauteurs naturels
et bondiront encore mieux après avoir atteint les niveaux d'expérience 6 et 12.
%%%%
Hellfire ability

Frappe vos ennemis avec des flammes infernales.
Expand Down Expand Up @@ -150,15 +140,6 @@ Turn Visible ability

Redevenir à nouveau visible.
%%%%
Evoke Jump Attack ability

Un talent qui utilise l'énergie cinétique d'une créature pour déclencher une
attaque sautée très rapide, qui vous fait atterrir à proximité en toute
sécurité. Vous ne pouvez pas sauter sur les ennemis volants et ne pouvez sauter
sur des ennemis géants que s'ils sont plongés dans la lave ou de l'eau
profonde. Être dans l'eau profonde, la lave, ou sur un sol liquéfié vous
empêcher également d'utiliser ce talent.
%%%%
Stop Flying ability

Atterrir.
Expand Down
15 changes: 0 additions & 15 deletions crawl-ref/source/dat/descript/ko/ability.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,6 @@ Fly ability

공중으로 날아오른다.
%%%%
Jump Attack ability

근처의 적에게 도약하여 근접 공격을 가한 뒤, 대상과 인접한 곳 어딘가로 착지한다.
비행중인 적을 뛰어넘을 수는 없으며 거대한 적은 용암이나 깊은 물에 가라앉아
있을때에만 뛰어 넘을 수 있다. 물 속에 서 있거나, 물이나 용암을 수영중이거나,
액화된 땅에 서 있는 상태 또한 이 능력을 사용할 수 없게 만든다. 펠리드는
선천적인 도약자로서 6 레벨과 12 레벨에 도달하면서 급습에 더욱 능숙해질 것이다.
%%%%
Hellfire ability

대상과 그 주변을 지옥불로 불태워버린다.
Expand Down Expand Up @@ -119,13 +111,6 @@ Turn Visible ability

투명화를 해제한다.
%%%%
Evoke Jump Attack ability

근처의 적에게 도약하여 근접 공격을 가한 뒤, 대상과 인접한 곳 어딘가로 착지한다.
비행중인 적을 뛰어넘을 수는 없으며 거대한 적은 용암이나 깊은 물에 가라앉아
있을때에만 뛰어 넘을 수 있다. 물 속에 서 있거나, 물이나 용암을 수영중이거나,
액화된 땅에 서 있는 상태 또한 이 능력을 사용할 수 없게 만든다.
%%%%
Stop Flying ability

비행을 그만둔다.
Expand Down
4 changes: 0 additions & 4 deletions crawl-ref/source/describe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1281,10 +1281,6 @@ static string _describe_armour(const item_def &item, bool verbose)
description += "It can be activated to allow its wearer to "
"fly indefinitely.";
break;
case SPARM_JUMPING:
description += "It can be activated to allow its wearer to "
"perform a jumping attack.";
break;
case SPARM_MAGIC_RESISTANCE:
description += "It increases its wearer's resistance "
"to enchantments.";
Expand Down

0 comments on commit 3cebfc1

Please sign in to comment.