see: http://luke.redirectme.net/redmine/projects/l2e/issues
return;
}
if (Victory()) {
return;
}
if (Victory()) {
- // TODO: push victory state
ctrl.PopState();
return;
}
if (Defeat()) {
ctrl.PopState();
return;
}
if (Defeat()) {
- // TODO: push defeat state
ctrl.PopState();
return;
}
ctrl.PopState();
return;
}
if (ac.GetType() == AttackChoice::DEFEND) return;
TargetSelection &ts(ac.Selection());
if (ac.GetType() == AttackChoice::DEFEND) return;
TargetSelection &ts(ac.Selection());
- // TODO: this only evaluates SWORD type attacks
if (CurrentAttack().isMonster) {
const Stats &attackerStats(MonsterAt(CurrentAttack().index).GetStats());
CalculateDamage(attackerStats, ts);
if (CurrentAttack().isMonster) {
const Stats &attackerStats(MonsterAt(CurrentAttack().index).GetStats());
CalculateDamage(attackerStats, ts);
AttackChoice &ac(m.GetAttackChoice());
TargetSelection &ts(ac.Selection());
ac.Reset();
AttackChoice &ac(m.GetAttackChoice());
TargetSelection &ts(ac.Selection());
ac.Reset();
- // TODO: run monster's attack script
int target(rand() % NumHeroes());
while (!HeroPositionOccupied(target)) {
target = rand() % NumHeroes();
int target(rand() % NumHeroes());
while (!HeroPositionOccupied(target)) {
target = rand() % NumHeroes();
}
Uint16 BattleState::CalculateDamage(const Stats &attacker, const Stats &defender) const {
}
Uint16 BattleState::CalculateDamage(const Stats &attacker, const Stats &defender) const {
- // TODO: find out real formula and add some randomness
return attacker.Attack() / 2 - defender.Defense() / 4;
}
return attacker.Attack() / 2 - defender.Defense() / 4;
}
void RunState::EnterState(Application &c, SDL_Surface *screen) {
ctrl = &c;
void RunState::EnterState(Application &c, SDL_Surface *screen) {
ctrl = &c;
- // TODO: push battle animation if enemy is faster
}
void RunState::ExitState(Application &c, SDL_Surface *screen) {
}
void RunState::ExitState(Application &c, SDL_Surface *screen) {
}
if (item->GetTargetingMode().TargetsAll()) {
ac.SetType(AttackChoice::ITEM);
}
if (item->GetTargetingMode().TargetsAll()) {
ac.SetType(AttackChoice::ITEM);
- // TODO: remove item from inventory
ac.SetItem(item);
battle->NextHero();
ctrl->PopState();
ac.SetItem(item);
battle->NextHero();
ctrl->PopState();
}
void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::Vector<int> &offset) {
}
void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::Vector<int> &offset) {
- // TODO: this should be related to the enemy's width
Vector<int> cursorOffset(cursorIcon->Width() / -2, cursorIcon->Height());
// offset the indicator by 1/8th to the right and top
Vector<int> indicatorOffset(cursorOffset + Vector<int>(cursorIcon->Width() / 8, cursorIcon->Height() / -8));
Vector<int> cursorOffset(cursorIcon->Width() / -2, cursorIcon->Height());
// offset the indicator by 1/8th to the right and top
Vector<int> indicatorOffset(cursorOffset + Vector<int>(cursorIcon->Width() / 8, cursorIcon->Height() / -8));
bool IsMagical() const { return !isPhysical; }
bool IsPhysical() const { return isPhysical; }
bool IsMagical() const { return !isPhysical; }
bool IsPhysical() const { return isPhysical; }
- // TODO: add missing ikari properties
-
// temporary setters
public:
void SetName(const char *n) { name = n; }
// temporary setters
public:
void SetName(const char *n) { name = n; }
HeroGroup &UsableBy() { return usableBy; }
const HeroGroup &UsableBy() const { return usableBy; }
HeroGroup &UsableBy() { return usableBy; }
const HeroGroup &UsableBy() const { return usableBy; }
- // TODO: add missing spell properties
-
// temporary setters
public:
void SetName(const char *n) { name = n; }
// temporary setters
public:
void SetName(const char *n) { name = n; }
-// TODO: animation when top row changes
template<class T>
class Menu {
template<class T>
class Menu {
maxim.SetIP(0);
maxim.SetStats(Stats(28, 22, 28, 17, 14, 100, 10));
ComplexAnimation maximAttackAnimation(&maximSprite, framerate);
maxim.SetIP(0);
maxim.SetStats(Stats(28, 22, 28, 17, 14, 100, 10));
ComplexAnimation maximAttackAnimation(&maximSprite, framerate);
- // TODO: cross check double frames; could be related to differences in framerates
- maximAttackAnimation.AddFrames(1, 0, Vector<int>(0, 0), 7); // TODO: maybe this could also be a pause before the battle animation
+ maximAttackAnimation.AddFrames(1, 0, Vector<int>(0, 0), 7);
maximAttackAnimation.AddFrames(1, 0, Vector<int>(4, -1), 2);
maximAttackAnimation.AddFrames(2, 0, Vector<int>(4, -2), 2);
maximAttackAnimation.AddFrames(2, 0, Vector<int>(6, -2), 2);
maximAttackAnimation.AddFrames(1, 0, Vector<int>(4, -1), 2);
maximAttackAnimation.AddFrames(2, 0, Vector<int>(4, -2), 2);
maximAttackAnimation.AddFrames(2, 0, Vector<int>(6, -2), 2);
maximAttackAnimation.AddFrames(2, 1, Vector<int>(0, 0), 1);
maximAttackAnimation.AddFrames(2, 2, Vector<int>(0, 0), 2);
maximAttackAnimation.AddFrames(2, 2, Vector<int>(2, 0), 1);
maximAttackAnimation.AddFrames(2, 1, Vector<int>(0, 0), 1);
maximAttackAnimation.AddFrames(2, 2, Vector<int>(0, 0), 2);
maximAttackAnimation.AddFrames(2, 2, Vector<int>(2, 0), 1);
- maximAttackAnimation.AddFrames(1, 0, Vector<int>(0, 0), 7); // TODO: maybe this could also be a pause between two animations
+ maximAttackAnimation.AddFrames(1, 0, Vector<int>(0, 0), 7);
maxim.SetAttackAnimation(&maximAttackAnimation);
ComplexAnimation maximSpellAnimation(&maximSprite, 5 * framerate);
maximSpellAnimation.AddFrames(3, 0, Vector<int>(), 2);
maxim.SetAttackAnimation(&maximAttackAnimation);
ComplexAnimation maximSpellAnimation(&maximSprite, 5 * framerate);
maximSpellAnimation.AddFrames(3, 0, Vector<int>(), 2);
Ikari lightGuard;
lightGuard.SetName("Light guard");
lightGuard.SetCost(128);
Ikari lightGuard;
lightGuard.SetName("Light guard");
lightGuard.SetCost(128);
- lightGuard.GetTargetingMode().TargetAllAllies(); // FIXME: actually only targets self
+ lightGuard.GetTargetingMode().TargetAllAllies(); // actually only targets self
lightGuard.SetMagical();
holyShield.SetIkari(&lightGuard);
maxim.SetShield(&holyShield);
lightGuard.SetMagical();
holyShield.SetIkari(&lightGuard);
maxim.SetShield(&holyShield);
Ikari boomerang;
boomerang.SetName("Boomerang");
boomerang.SetCost(164);
Ikari boomerang;
boomerang.SetName("Boomerang");
boomerang.SetCost(164);
- boomerang.GetTargetingMode().TargetAllAllies(); // FIXME: actually only targets self
+ boomerang.GetTargetingMode().TargetAllAllies(); // actually only targets self
boomerang.SetMagical();
legendHelm.SetIkari(&boomerang);
maxim.SetHelmet(&legendHelm);
boomerang.SetMagical();
legendHelm.SetIkari(&boomerang);
maxim.SetHelmet(&legendHelm);
Ikari ironBarrier;
ironBarrier.SetName("Iron barrier");
ironBarrier.SetCost(255);
Ikari ironBarrier;
ironBarrier.SetName("Iron barrier");
ironBarrier.SetCost(255);
- ironBarrier.GetTargetingMode().TargetAllAllies(); // FIXME: actually only targets self
+ ironBarrier.GetTargetingMode().TargetAllAllies(); // actually only targets self
ironBarrier.SetMagical();
megaShield.SetIkari(&ironBarrier);
guy.SetShield(&megaShield);
ironBarrier.SetMagical();
megaShield.SetIkari(&ironBarrier);
guy.SetShield(&megaShield);