Attached Files |
new 1.txt [^] (5,734 bytes) 2018-09-29 00:17 [Show Content] [Hide Content]//First of all, hello. Attribute:
//crawl-ref/source/attribute-type.h
ATTR_DOORJUMP,
//You can change "DJ" to "Doorjump". No music there anyway.
//crawl-ref/source/status.cc
case STATUS_DOORJUMP:
if (you.attribute[ATTR_DOORJUMP])
{
inf.light_colour = WHITE;
inf.light_text = "DJ";
inf.short_text = "doorjump";
inf.long_text = "You can jump off closed doors.";
}
//And line "STATUS_DOORJUMP," for /crawl-ref/source/status.h, if I understood it the right way.
//There goes simple ability, just as Sif's cast:
//crawl-ref/source/ability.cc
{ ABIL_WU_JIAN_DOORJUMP, "Enable doorjumping",
0, 0, 0, 0, {fail_basis::invo}, abflag::instant | abflag::starve_ok },
{ ABIL_WU_JIAN_STOP_DOORJUMP, "Stop doorjumping",
0, 0, 0, 0, {fail_basis::invo}, abflag::instant | abflag::starve_ok },
//The second part:
case ABIL_WU_JIAN_DOORJUMP:
mpr("You can jump off closed doors now.");
you.attribute[ATTR_DOORJUMP] = 1;
break;
case ABIL_WU_JIAN_STOP_DOORJUMP:
mpr("You can't jump off closed doors now.");
you.attribute[ATTR_DOORJUMP] = 0;
break;
//And the third part in "ability_type fixup_ability(ability_type ability)"
case ABIL_WU_JIAN_DOORJUMP:
if (you.attribute[ATTR_DOORJUMP])
return ABIL_WU_JIAN_STOP_DOORJUMP;
return ability;
// And the fourth part at 3638 line.
// However, I can't do this one, becouse I lack understanding
// of push_back() interaction with the third part.
// Will this work fine
if (silenced(you.pos()) && you_worship(GOD_WU_JIAN) && piety_rank() >= 2)
abilities.push_back(ABIL_WU_JIAN_DOORJUMP);
// or do I have to do it this way?
if (silenced(you.pos()) && you_worship(GOD_WU_JIAN) && piety_rank() >= 2)
if (!(you.attribute[ATTR_DOORJUMP]))
abilities.push_back(ABIL_WU_JIAN_DOORJUMP);
else
abilities.push_back(ABIL_WU_JIAN_STOP_DOORJUMP);
//And lines with this abilities' names for crawl-ref/source/ability-type.h, if I understood it the right way one more time.
//There goes religion. Look! Some pasta fell from the sky! What could it mean?
//crawl-ref/source/religion.cc
// Wu Jian
{ { 0, "perform damaging attacks by moving towards foes",
"perform lunging strikes" },
{ 1, "lightly attack and pin monsters in place by moving around them",
"perform spinning attacks" },
// { 2, ABIL_WU_JIAN_WALLJUMP,
// "perform airborne attacks" },
{ 2, ABIL_WU_JIAN_DOORJUMP,
"perform airborne attacks" },
{ 3, ABIL_WU_JIAN_SERPENTS_LASH, "briefly move at supernatural speeds",
"move at supernatural speeds" },
{ 5, ABIL_WU_JIAN_HEAVENLY_STORM, "summon a storm of heavenly clouds to empower your attacks",
"summon a storm of heavenly clouds" },
},
//Second part of religion. Turn off DJ in the
//void lose_piety(int pgn) function. Just next to Sif Muna's cast toggle.
// Deactivate the toggle
if (power.abil == ABIL_SIF_MUNA_DIVINE_ENERGY)
you.attribute[ATTR_DIVINE_ENERGY] = 0;
if (power.abil == ABIL_WU_JIAN_DOORJUMP)
you.attribute[ATTR_DOORJUMP] = 0;
//There go pictures. Currently there's none, of course.
//crawl-ref/source/tilepick.cc
// Wu Jian
// case ABIL_WU_JIAN_WALLJUMP:
// return TILEG_ABILITY_WU_JIAN_WALL_JUMP;
case ABIL_WU_JIAN_DOORJUMP:
return TILEG_ABIL_WU_JIAN_DOORJUMP;
case ABIL_WU_JIAN_STOP_DOORJUMP:
return TILEG_ABIL_WU_JIAN_STOP_DOORJUMP;
case ABIL_WU_JIAN_SERPENTS_LASH:
return TILEG_ABILITY_WU_JIAN_SERPENTS_LASH;
case ABIL_WU_JIAN_HEAVENLY_STORM:
return TILEG_ABILITY_WU_JIAN_HEAVENLY_STORM;
//No travel with DJ.
//You can turn off DJ when travel starts, but I'm too lazy to do that. Just let a player press the button.
//crawl-ref/source/travel.cc, 3027 line:
void do_explore_cmd()
{
if (apply_starvation_penalties())
mpr("You need to eat something NOW!");
else if (you.berserk())
mpr("Calm down first, please.");
else if (you.attribute[ATTR_DOORJUMP])
mpr("Stop using doors as walls, please."); //I'm not sure about the message, but this one looks nice.
else if (player_in_branch(BRANCH_LABYRINTH))
mpr("No exploration algorithm can help you here.");
else // Start exploring
start_explore(Options.explore_greedy);
}
//Now delete doorjump stopper in the crawl-ref/source/main.cc 2965 line
//And call doorjump after the common walljump call at 3178 line with 'else if'.
//Perform doorjump if 'Y'; open door if 'n' or quit. "if I understood it the right way"
//crawl-ref/source/main.cc
else if (can_wall_jump && !running)
{
if (!wu_jian_do_wall_jump(targ, false))
return; // wall jump only in the ready state, or cancelled
else
did_wall_jump = true;
}
else if (can_wall_jump && feat_is_closed_door(targ_grid) && you.attribute[ATTR_DOORJUMP] && !running)
if (yesno("Do you want to perform walljump?", false, 'n'))
{
if (!wu_jian_do_wall_jump(targ, false))
return; // wall jump only in the ready state, or cancelled
else
did_wall_jump = true;
}
//Turn DJ on, if went berserk.
//crawl-ref/source/player-act.cc 715 line
bool player::go_berserk(bool intentional, bool potion)
{
...
if (have_passive(passive_t::wu_jian_wall_jump) && !you.attribute[ATTR_DOORJUMP])
{
mpr("You can jump off closed doors now."); //Not sure about message. Maybe omit?
you.attribute[ATTR_DOORJUMP] = 1;
}
...
}
//That's all I guess. Should fix bugs reported by CanOfWorms.
//Since that leaves only one way to activate walljump...
//And, maybe clear all leftover ABIL_WU_JIAN_WALLJUMP entries. Except for those matching other passive Wu Jian abilities.
|