Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditions in Battles #815

Merged
merged 10 commits into from Mar 14, 2016
Merged

Conditions in Battles #815

merged 10 commits into from Mar 14, 2016

Conversation

Tondorian
Copy link
Member

Conditions are applied to battle_actors now.
GainMoneyMessage only shown if money >0

I only tested it with rpg Maker 2k but should work on 2k3...

GainMoneyMessage only shown if money >0
int hp = state.hp_change_val;
int sp = state.sp_change_val;
int source_hp = source->GetHp();
int source_sp = source->GetSp();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray spaces detected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed

@Ghabry
Copy link
Member

Ghabry commented Mar 12, 2016

Jenkins: Test this please

@Ghabry
Copy link
Member

Ghabry commented Mar 12, 2016

One reason speaking against ::Apply is that under RPG2k3 all actors get damage at the begin of a battle action (doesn't matter if ally or enemy). With Apply only the current one doing the action gets damage.

I suggest moving this to a function in Game_Battler and when invoking that function it directly alters SP and MP of that Battler.

For RPG2k you can place the call in ... maybe BattleActionState_ConditionHeal (for the FirstAttack case)

So for RPG2k3 I suggest placing the call to this function (and displaying the damage number (for HP only!) as a floating number) in the BattleActionState_Start for the "IsFirstAttack" case.

The RPG2k3 battle system also shows that damaging due to states happens before the action is executed.

@Tondorian
Copy link
Member Author

git commit --amend failed again 👎

@Ghabry
Copy link
Member

Ghabry commented Mar 12, 2016

git reset HEAD~1 :D should work

Because you use Windows you should consider tortoise git

RPG_RT2k3 should show damage numbers now
@Ghabry
Copy link
Member

Ghabry commented Mar 12, 2016

Jenkins: Test this please

@@ -532,6 +532,15 @@ bool Scene_Battle_Rpg2k3::ProcessBattleAction(Game_BattleAlgorithm::AlgorithmBas

if (action->IsFirstAttack() && action->GetStartSe()) {
Game_System::SePlay(*action->GetStartSe());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The damageTaken codepath depends on action->GetStartSe()

@Ghabry
Copy link
Member

Ghabry commented Mar 12, 2016

Test case for RPG Maker 2003 (add a RPG_RT.exe):
BattleTest with Monster Party 2.

rpg2k3 testcase.zip

Command Line for Player: "BattleTest 2"

@Ghabry
Copy link
Member

Ghabry commented Mar 12, 2016

Test case for RPG Maker 2000
BattleTest with Monster Party 1.

rpg2k battletest.zip

return false;
}

// Reset variables
battle_action_state = BattleActionState_Start;
battle_action_state = BattleActionState_ConditionHeal;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You changed all the battle_action_state transitions. This is super super risky, pls don't do this unless you are 100% certain this is required. Because this must be tested with every available battle action available (Normal, different items, different skills, defend) to proof that it doesn't break anything or added a subtil bug.

One problem I already noticed is, that you introduced some delay before everybodys turn.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i needed to change them to get poisen effect working before the battlers attack.
think need to double check, if waiting is needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted all the state changes and I only took your code from line 370 to 388 and it still works fine for me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it shows conditioneffct, Clean enemyAttacks, Damage clean to you?
Takes me 2h yesterday to get it shown correct

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my tests your state changes broke the message box. At the beginning it shows an empty message box with a delay and between battle actions, too.

And after an enemy finished his battle animation the delay got removed.

RPG2k Message Delay fixed
Cleanup ConditionApply() and fixed damage calculation
@Ghabry
Copy link
Member

Ghabry commented Mar 13, 2016

The delay is still wrong here.

Normal attacks without any states have a 30 frame delay before anything happens -> Must be 0.

And after battle animations the feedback is now instant instead of a delay. (After showing the attack animation, e.g. the sword slash, the old version had a 30 frame delay).

And sometimes enemy attacks give me now a negative amount and heal me :O

@Tondorian
Copy link
Member Author

I think it should work as expected now
if you can confirm, i'll clean up my branch

@Ghabry
Copy link
Member

Ghabry commented Mar 13, 2016

I will prepare an emscripten test case for both battle systems this evening.
Then it's easier to verify this (also for future pull requests).

But I think you are getting closer now :D

@Ghabry Ghabry added this to the 0.4.1 milestone Mar 13, 2016
@carstene1ns
Copy link
Member

Needs #include <cmath>, http://www.cplusplus.com/reference/cmath/ceil/

fix another timing error
@Ghabry
Copy link
Member

Ghabry commented Mar 14, 2016

Jenkins: Test this please

@fdelapena Maybe we should whitelist him ;)

@Tondorian
Copy link
Member Author

And sometimes enemy attacks give me now a negative amount and heal me :O

See this on your Emscripten Testcase first time
I think i did not change anything on this part game_battlealgoithm.cpp

@fdelapena
Copy link
Contributor

@fdelapena Maybe we should whitelist him ;)

Done!

I think i did not change anything on this part game_battlealgoithm.cpp

Yeah, Ghabry commented on IRC this also happens with the current upstream master version.

@Tondorian
Copy link
Member Author

but i messed up dead enemys in rpg2k3 :D if they are dead they get 1hp ^^
will fix this part now

@Ghabry
Copy link
Member

Ghabry commented Mar 14, 2016

Okay, looks fine now. The negative HP after attacks and poison are strange but this already happens in Master... :(.
@Tondorian Is the PR ready?

@Ghabry
Copy link
Member

Ghabry commented Mar 14, 2016

The problem for that "-5" is the skill damage code in Game_BattleAlgorithm::Skill::Execute()

We need a "effect < 0 -> = 0" check before the line with rand().

Ghabry added a commit that referenced this pull request Mar 14, 2016
@Ghabry Ghabry merged commit 118e900 into EasyRPG:master Mar 14, 2016
@Tondorian Tondorian deleted the mergeRequest branch March 14, 2016 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants