From f35f22155423e37755625161135a2866d99bc0c1 Mon Sep 17 00:00:00 2001 From: Saveliy Skresanov Date: Wed, 8 May 2013 23:36:04 +0700 Subject: [PATCH] Rocket boots for fighters. --- src/simulation/elements/FIGH.cpp | 18 ++++++++++++++---- src/simulation/elements/STKM.cpp | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/simulation/elements/FIGH.cpp b/src/simulation/elements/FIGH.cpp index 767805bb1..6320c2dad 100644 --- a/src/simulation/elements/FIGH.cpp +++ b/src/simulation/elements/FIGH.cpp @@ -90,26 +90,36 @@ int Element_FIGH::update(UPDATE_FUNC_ARGS) } else if (tarxeval_move(PT_FIGH, figh->legs[4]-10, figh->legs[5]+6, NULL) + if(figh->rocketBoots || !(sim->eval_move(PT_FIGH, figh->legs[4]-10, figh->legs[5]+6, NULL) && sim->eval_move(PT_FIGH, figh->legs[4]-10, figh->legs[5]+3, NULL))) figh->comm = 0x01; else figh->comm = 0x02; - if (!sim->eval_move(PT_FIGH, figh->legs[4]-4, figh->legs[5]-1, NULL) + if (figh->rocketBoots) + { + if (tarycomm = (int)figh->comm | 0x04; + } + else if (!sim->eval_move(PT_FIGH, figh->legs[4]-4, figh->legs[5]-1, NULL) || !sim->eval_move(PT_FIGH, figh->legs[12]-4, figh->legs[13]-1, NULL) || sim->eval_move(PT_FIGH, 2*figh->legs[4]-figh->legs[6], figh->legs[5]+5, NULL)) figh->comm = (int)figh->comm | 0x04; } else { - if (!(sim->eval_move(PT_FIGH, figh->legs[12]+10, figh->legs[13]+6, NULL) + if (figh->rocketBoots || !(sim->eval_move(PT_FIGH, figh->legs[12]+10, figh->legs[13]+6, NULL) && sim->eval_move(PT_FIGH, figh->legs[12]+10, figh->legs[13]+3, NULL))) figh->comm = 0x02; else figh->comm = 0x01; - if (!sim->eval_move(PT_FIGH, figh->legs[4]+4, figh->legs[5]-1, NULL) + if (figh->rocketBoots) + { + if (tarycomm = (int)figh->comm | 0x04; + } + else if (!sim->eval_move(PT_FIGH, figh->legs[4]+4, figh->legs[5]-1, NULL) || !sim->eval_move(PT_FIGH, figh->legs[4]+4, figh->legs[5]-1, NULL) || sim->eval_move(PT_FIGH, 2*figh->legs[12]-figh->legs[14], figh->legs[13]+5, NULL)) figh->comm = (int)figh->comm | 0x04; diff --git a/src/simulation/elements/STKM.cpp b/src/simulation/elements/STKM.cpp index c7386f6cc..55fac92a7 100644 --- a/src/simulation/elements/STKM.cpp +++ b/src/simulation/elements/STKM.cpp @@ -395,7 +395,7 @@ int Element_STKM::run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { playerp->elem = SPC_AIR; else if (sim->bmap[(ry+y)/CELL][(rx+x)/CELL]==WL_EHOLE) playerp->rocketBoots = false; - else if (sim->bmap[(ry+y)/CELL][(rx+x)/CELL]==WL_GRAV && parts[i].type!=PT_FIGH) + else if (sim->bmap[(ry+y)/CELL][(rx+x)/CELL]==WL_GRAV /* && parts[i].type!=PT_FIGH */) playerp->rocketBoots = true; if ((r&0xFF)==PT_PRTI) Element_STKM::STKM_interact(sim, playerp, i, rx, ry);