Skip to content

Commit

Permalink
[Issue] Fixed #32.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed May 23, 2014
1 parent 2257d25 commit 956620c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
9 changes: 4 additions & 5 deletions Notes
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
- Add other Lua pseudo-classes like "Enemy", "Door", "Teleporter", etc...

- Fix issues:
* #32 - Sometimes, when the actors win the battle, there's another turn, then a segfault
* #29 - Improve victory window
* #19 - Improve Activity rendering by screenshotting and saving previous screen, to display it faster
* #17 - Up and Down keys have an higher priority than Left and Right ones
* #16 - Work on transitions between maps
* #14 - Improve some code parts
* #16 - Work on transitions between maps
* #17 - Up and Down keys have an higher priority than Left and Right ones
* #19 - Improve Activity rendering by screenshotting and saving previous screen, to display it faster
* #29 - Improve victory window

- Let ItemWindows get data they'll display
- Adapt ItemWindow to in-battle display
Expand Down
3 changes: 2 additions & 1 deletion data/config/actors.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<actors>
<actor name="Arshes" appearance="Fighter01">
<stats level="1" hp="80" sp="50" atk="15" def="10"/>
<stats level="56" hp="4589" sp="4268" atk="1239" def="952"/>
<!-- <stats level="1" hp="80" sp="50" atk="15" def="10"/> !-->
<charalink id="-1"/>
</actor>
<actor name="Basil" appearance="Lancer01">
Expand Down
20 changes: 10 additions & 10 deletions source/BattleActivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,34 +199,34 @@ void BattleActivity::update() {
}

if(m_mode == Mode::ProcessActions) {
if(m_battle->actionStackEmpty()) {
m_mode = Mode::Choice;
return;
}

if(!m_processingAction) {
u8 i = 0;
for(auto &it : m_battle->actors()) {
if(it.second->hp() == 0) i++;
}

u8 j = 0;
for(auto &it : m_battle->enemies()) {
if(it.second->hp() == 0) j++;
}

if(i == m_battle->actors().size()) {
m_mode = Mode::GameOver;
return;
}

u8 j = 0;
for(auto &it : m_battle->enemies()) {
if(it.second->hp() == 0) j++;
}

if(j == m_battle->enemies().size()) {
m_mode = Mode::Victory;
DialogActivity *dialog = ActivityManager::newDialogWithParent(this);
dialog->addMessage("You win! 999999 exp 999ø");
return;
}

if(m_battle->actionStackEmpty()) {
m_mode = Mode::Choice;
return;
}

m_battle->processAction();

m_processingAction = true;
Expand Down
2 changes: 1 addition & 1 deletion source/Battler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ u8 a = 255;
void Battler::kill() {
if(r < 248) {
r += 7;
m_image->setColorMod(Color(r, 255, 255));
m_image->setColorMod(Color(r, 128, 128));
}

if(a > 10) {
Expand Down
1 change: 1 addition & 0 deletions source/DialogActivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void DialogActivity::update() {

if(m_msgwin->messages().size() == 0) {
ActivityManager::pop();
ActivityManager::top()->update();
}
}

Expand Down

0 comments on commit 956620c

Please sign in to comment.