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

Add custom game settings #2564

Merged
merged 33 commits into from Sep 2, 2021
Merged

Add custom game settings #2564

merged 33 commits into from Sep 2, 2021

Conversation

ghost
Copy link

@ghost ghost commented Jun 24, 2021

Depends on liblcf#421

This PR adds the following game settings which can be set in the game database:

  • BattleCommands: Default ATB mode
  • BattleCommands: Enable in-battle row command
  • BattleCommands: Sequential order battling
  • Skills: Ignore reflect state
  • Skills: State infliction hit rate
  • Skills: Attribute shift hit rate
  • Skills: Ignore physical rate restriction by states
  • Skills: Ignore magical rate restriction by states
  • Items: Maximum item count in inventory
  • System: Alternative EXP curve
  • System: Battle options
  • System: Maximum actor HP value
  • System: Maximum enemy HP value
  • System: Maximum damage value
  • System: Maximum EXP value
  • System: Maximum level
  • System: Enable stat absorbing
  • System: Maximum number of savegame slots
  • System: Default maximum item count in inventory
  • System: Minimum variable value
  • System: Maximum variable value
  • System: Maximum actor SP value
  • System: Maximum enemy SP value
  • System: Maximum base stat value
  • System: Maximum battle stat value

// Skills invoked by items ignore reflect
if (item) {
// Skills invoked by items and skills with the attribute
// "easyrpg_ignore_reflect" set ignore reflect
Copy link
Member

Choose a reason for hiding this comment

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

Add "easyrpg_ignore_reflect" attribute for skills

Wrong spacing. Imo that entire comment is useless because it simply states what you can already see in the if. So delete it, thx.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@@ -563,7 +563,7 @@ std::vector<std::string> Scene_Battle_Rpg2k3::GetBattleCommandNames(const Game_A
commands.push_back(ToString(cmd->name));
}
}
commands.push_back(ToString(lcf::Data::terms.row));
if (lcf::Data::battlecommands.easyrpg_enable_battle_row_command) commands.push_back(ToString(lcf::Data::terms.row));
Copy link
Member

Choose a reason for hiding this comment

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

Style: Wrap in {}

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@Ghabry
Copy link
Member

Ghabry commented Jul 13, 2021

A commit to address all review comments is a good idea, otherwise you have too much to rebase & edit, is not worth it.

int top = Player::IsRPG2k() ? 6 : 7;
// At least 7 digits because of gold input in debug scene
// (free space and 6 digits for the gold value)
int top = std::max(7, digits_max);
Copy link
Member

@Ghabry Ghabry Jul 13, 2021

Choose a reason for hiding this comment

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

Add settings for minimum and maximum variable values

this looks wrong because digits_max is updated by the param idigits_max afterwards

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@Ghabry
Copy link
Member

Ghabry commented Jul 13, 2021

About these max stat base value things:
Imo it would make sense to have new function in Game_System for them but still delegate them through Game_Actor/Enemy for more flexibility (when we add new chunks to have per-character max values).
I will append my own commit for this later as this is faster than adding 10 review comments :)

  • Add setting for maximum EXP value
  • Add setting for maximum level
  • Add setting for maximum number of savegame slots
  • Add setting for maximum actor SP value
  • Add setting for maximum enemy SP value
  • Add setting for maximum base stat value
  • Add setting for maximum battle stat value
  • Add setting for maximum actor HP value
  • Add setting for maximum enemy HP value
  • Add setting for maximum damage value

SetIsSuccess();
}
}
if (skill.affect_agility && Rand::PercentChance(to_hit)) {
const auto agi = target->CanChangeAgiModifier(effect);
if (agi != 0) {
SetAffectedAgi(agi);
if (lcf::Data::system.easyrpg_enable_stat_absorbing) SetIsAbsorbAgi(absorb);
Copy link
Member

@Ghabry Ghabry Jul 13, 2021

Choose a reason for hiding this comment

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

Add option to enable stat absorbing

Please also fix the indent and add {} for these 4

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@Ghabry
Copy link
Member

Ghabry commented Jul 13, 2021

Add option to disable auto battling

Maybe this should be "overengineered" a bit: Instead of a bool-flag make it a number-vector like the BattleCommands or the Menu Items:
https://github.com/EasyRPG/Player/blob/master/src/scene_menu.cpp#L97

By default it is "0, 1, 2", representing Fight, Auto Battle, Escape and then allow removal of options. This makes it also easier to invent new options here :)

@Ghabry
Copy link
Member

Ghabry commented Jul 28, 2021

btw, I'm sorry that this takes so long but be assured that this will land in 0.7.0

I'm 99% in favor of these improvements 👍

@ghost
Copy link
Author

ghost commented Jul 31, 2021

The number-vector for the battle options has been implemented now. System option 201 has been replaced now from "Enable auto battle" to "Battle options". The default setting is 0, 1, 2 (Battle, Auto battle and Escape) (see this comment).

@Ghabry
Copy link
Member

Ghabry commented Aug 28, 2021

@rueter37 I rewrote parts of the code to reduce code duplication, please check if I broke something.

Also check the Sp Window in Battle 2k3, this needed a bit more changes because this depends now on the actor, before it was fixed...

@ghost
Copy link
Author

ghost commented Aug 29, 2021

@Ghabry Your changes work for me, I only had to fix the SP window, the correct window size wasn't applied if the maximum SP value was greater than 999. Moreover the "Enable stat absorbing" feature is a per skill option now.

@ghost ghost marked this pull request as ready for review August 29, 2021 14:39
rueter37 added 13 commits August 31, 2021 17:33
The default ATB mode can now be set in the database.
Skills which have the "easyrpg_ignore_reflect" attribute set ignore
skill reflection. This is useful for skills which are meant to be
physical or for skills which are supposed to remove reflect or
positive states from the enemy.
The in-battle "Row" command can now be disabled in the database.
A database option has been added which forces the battlers to take
actions in a fixed order even in alternative and gauge battle types.
A database option has been added which makes the game use
a certain EXP calculation formula.
Auto battling can now be disabled in the database.
The maximum actor HP value can now be set in the database. If it is
unset, the default value is used depending on the engine.
The maximum enemy HP value can now be set in the database. If it is
unset, the default value is used depending on the engine.
The maximum damage value can now be set in the database. If it is
unset, the default value is used depending on the engine.
The maximum EXP value can now be set in the database. If it is
unset, the default value is used depending on the engine.
The maximum level can now be set in the database. If it is
unset, the default value is used depending on the engine.
Absorbing attack, defense, spirit and agility can now be enabled
in the database.
The maximum number of savegame slots can now be set in the database.
If it is unset, the default value of 15 is used.
rueter37 and others added 19 commits August 31, 2021 17:33
The maximum item count for a certain item can now be set with the
"easyrpg_max_count" attribute. Moreover a default maximum item
count can be set in the database. The default maximum item
count is 99 if the default maximum item count is not set.
If the "easyrpg_state_hit" attribute has been set on a skill,
use this hit rate for inflicting states instead of the skill
hit rate.
If the "easyrpg_attribute_hit" attribute has been set on a skill,
use this hit rate for applying attribute shifts instead of the
skill hit rate.
If the "easyrpg_ignore_restrict_skill" attribute has been set on
a skill, this skill can even by used if the user is affected by
a state which restricts usage of physical skills.
If the "easyrpg_ignore_restrict_magic" attribute has been set on
a skill, this skill can even by used if the user is affected by
a state which restricts usage of magical skills.
The absolute minimum and maximum value of a variable can now be
set in the database.
The maximum actor SP value can now be set in the database. If it is
unset, the default value of 999 is used.
The maximum enemy SP value can now be set in the database. If it is
unset, the default value of 9999 is used.
The maximum base stat value can now be set in the database.
If it is unset, the default value of 999 is used.
The maximum battle stat value can now be set in the database.
If it is unset, the default value of 9999 is used.
This commit is meant to address the review comments.
The available battle options (Battle, Auto battle and Escape) can now
be set in the database. This option replaces the enable auto battle
option.
Makes the code easier to read and easier to extend later when there are per-battler limits
Abort when variable range is invalid
The SP window size had the wrong size if the maximum actor SP is
greater than 999. This is fixed now.
Absorbing attack, defense, spirit and agility is now a per skill
option and no longer a global system option.
The HP and SP string lengths are now based on the global maximum
actor HP and SP values.
@Ghabry Ghabry changed the title Add custom game settings (liblcf #421) Add custom game settings Aug 31, 2021
@Ghabry
Copy link
Member

Ghabry commented Aug 31, 2021

jenkins: test this please

commands.push_back(ToString(lcf::Data::terms.battle_auto));
commands.push_back(ToString(lcf::Data::terms.battle_escape));

for (std::vector<int16_t>::iterator it = lcf::Data::system.easyrpg_battle_options.begin();
Copy link
Member

Choose a reason for hiding this comment

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

this can be replaced with "for (auto option: easyrpg_battle_options)"

Same for "All all menu items" below

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

The review comment for scene_battle has been addressed now.
@fdelapena fdelapena added the Settings All about customizable features, storing and applying them label Aug 31, 2021
@fdelapena fdelapena merged commit bc9f649 into EasyRPG:master Sep 2, 2021
@ghost ghost deleted the features branch September 2, 2021 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Battle Database Enhancement Settings All about customizable features, storing and applying them
Development

Successfully merging this pull request may close these issues.

None yet

2 participants