Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mateofio
Copy link
Contributor

@mateofio mateofio commented Nov 5, 2018

2.30: RM2000 + RM2003: Mark as "unusable" the objects of type "speci

If I understand this correctly the purpose of the new line in ÌsitemUsable is to ensure that the items are always selectable semi-ot: occasion_field1 is btw confusing, maybe we should think about a better name

I see multiple flaws here:
item.actor_set could be also item.class_set, therefore we should fine a way to get this handled by IsItemUsable imo. (maybe move the check from IsItemUsable to CheckEnable, then the codepath is free)

Also actor_set could be smaller than the ID, resulting in an out-of-bounds read.

@mateofio mateofio changed the title "2.30: RM2000 + RM2003: Mark as "unusable" the objects of type "speci… Albeleon Battle Fixes 2.5 of N Nov 5, 2018
@mateofio mateofio changed the title Albeleon Battle Fixes 2.5 of N 2.30: RM2000 + RM2003: Mark as "unusable" the objects of type "speci… Nov 6, 2018
@mateofio
Copy link
Contributor Author

mateofio commented Nov 6, 2018

I've checked and the following behavior exists in battles when the item is not "usable"

RM2k:

  • Special: Actor cannot select the item
  • Medicine: Anyone can use, but if used on actor who cannot use then there is no effect.
  • Book: Cannot be used in battle

RM2k3:

  • Special: Actor cannot select the item
  • Equipment with skill use: Actor cannot select the item
  • Book: Cannot be used in battle
  • Medicine:
    • equipment_setting == actor: Anyone can select, but if used on actor who cannot use then there is no effect.
    • equipment_setting == class: Anyone can select, even if class is set to not usable! (BUG in rm2k3)?

@CherryDT Maybe another rm2k3 bug here for you.

@mateofio mateofio force-pushed the alb_2.30 branch 2 times, most recently from 29b896c to 674d96e Compare November 6, 2018 01:34
@mateofio
Copy link
Contributor Author

mateofio commented Nov 6, 2018

I've reimplemented this from scratch. Tested the behavior against both rm2k and rm2k3. All matching.

I've opted to fix the rm2k3 class bug here.

@mateofio mateofio changed the title 2.30: RM2000 + RM2003: Mark as "unusable" the objects of type "speci… Fix Item usability in battle - Previously Albeleon 2.30 Nov 6, 2018
@Ghabry Ghabry added this to the 0.5.5 (or 0.6.0) -> we will see milestone Nov 6, 2018
if (item.type == RPG::Item::Type_medicine) {
this->healing = true;
if (GetTarget()->GetType() == Game_Battler::Type_Ally && !static_cast<Game_Actor*>(GetTarget())->IsItemUsable(item.ID)) {
//No effect, but doesn't behave like a dodge or damage to set healing and success to true.
Copy link
Member

Choose a reason for hiding this comment

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

whitespace after //

@Ghabry
Copy link
Member

Ghabry commented Nov 6, 2018

Could you add a comment to Game_Battler:IsItemUsable which mentions this bug (that RPG2k3 only cares about actor_set for medicine in battle)? Better preserve this knowledge, if this is ever a problem later.

@CherryDT
Copy link

CherryDT commented Nov 6, 2018

Another thing which I'd put as "compat mode"...
There are so many bugs, especially in RM2k3, which are for me a conflict between "supporting existing RM games" and "building a game engine usable on its own which can be even better than RM"

@Ghabry
Copy link
Member

Ghabry commented Nov 6, 2018

I find this bug especially silly because first they added this ridiculous global radio button and then they failed to implement it correctly. 😥

How to do this compat mode thing? Maybe add a new enum to "Player::engine" (EngineEasyRPG and when this is set by a (default) setting in our editor the compat mode is off)

* Medicines always selectable by all, but silently no effect
  if used on actor who cannot use.
* Other items not selectable if not usable.
* Rm2k3 has a bug where medicines always usable if
  equipment_setting == class. We fix the bug here.
@mateofio
Copy link
Contributor Author

mateofio commented Nov 6, 2018

Fixed comments. I put the bug comment in battlealgorithm, because Game_Actor::IsItemUsable() is also used by the menu in the field, and here it behaves correctly.

@carstene1ns carstene1ns merged commit 02c402e into EasyRPG:master Nov 7, 2018
@mateofio mateofio deleted the alb_2.30 branch November 15, 2018 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants