Ace: adding new end of turn methods in battle

Countyoungblood

Sleeping Dragon
Veteran
Joined
Dec 9, 2017
Messages
622
Reaction score
403
First Language
English
Primarily Uses
RMVXA
I need a method to run at the end of every turn
Ive been searching in battlerbase but turn and end are...very...common...terms...

where is the code for what happens at the end of each turn?

Update: found the code in Game_battler line 799.. its a method called on_turn_end now to write a method and add/test it.
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,503
First Language
Indonesian
Primarily Uses
RMVXA
on_turn_end in Game_Battler runs once in the context of the battler. Means if you have 8 battlers (actors and enemies) it will run 8 times in each battler. If you want to run it once, try to modify Scene_Battle --> turn_end (line 493)
 

Countyoungblood

Sleeping Dragon
Veteran
Joined
Dec 9, 2017
Messages
622
Reaction score
403
First Language
English
Primarily Uses
RMVXA
on_turn_end in Game_Battler runs once in the context of the battler. Means if you have 8 battlers (actors and enemies) it will run 8 times in each battler. If you want to run it once, try to modify Scene_Battle --> turn_end (line 493)
thanks theo! saved me some time/frustration already.

My goal is a method which would update placeholder states dependent on current MP% and current states.. but i think id also need a way to make sure two of these states couldnt apply at the same time since im using them to assign animations. assigning the animations to the states is already handled by the graphics side but I need something to see the state..apply the state effect (MP damage) and remove the state/add the next state. such as for example.. poison1 to poison2 to poison3.

me and you have had a similar conversation here before and you provided something im trying to adapt but i think im still missing some things.

Code:
def combo_attack(a,b)
  #--------------------------------------------
  # State ID to check => State ID to add
  # Edit here:
  #--------------------------------------------
  states = {
   14 => 15,
   15 => 16,
   16 => 16,
  }
  #--------------------------------------------
  states.keys.each do |state_id|
   if a.state?(state_id)
     a.remove_state(state_id)
     a.add_state(states[state_id])
     return
   end
  end
  # Else
  a.add_state(14) # <-- Also here
  return  # <-- Also here
end
id imagine it'd be something like..

when a.state?(state_id) || a.mp=>90%

but im struggling to understand the best approach. should i create a second method that toggles out the states when called since it can only be one of them? (if a then not b or c, if b then not a or c... ect.)

I want the method to check for states each turn and if certain states are present check the current MP of the actor and reduce the actors MP
by a quantity assigned in the state note per turn and also remove/assign a new state if the MP value is outside of the range for that state.

state1 might be 90% to 100% MP and damages MP by 10 points per turn
state2 might be 60% to 90% MP and damages MP by 30 points per turn
state3 might be 30% to 60% MP and damages MP by 50 points per turn..

any thoughts?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Tomorrow is Thanksgiving, and I'm so excited! I've been exploring MZ a little, and I just downloaded Effekseer to make new animations. I have experience in 3D animation software, so I'll be pretty good at the whole "particle" thing. My first game on MZ will be Fantasy Force--starring a griffin, a dragon, and a pegasus fighting against the Dragon of Darkness.
currently listening to Driftwood Gaming streaming some MZ dev time and it's delightful! had no idea they were this entertaining, love it
In quarantine, will be tested soon. This year is really something... special.
I was at another orientation yesterday and I realized I'll be working with an old friend! We met at the local water park a few years back and it was so nice to see her again! We had a chat, and next week when I officially start, I'll see if maybe we can trade our Zoom IDs so we can talk!
I made some sideview closets for MV!
You can find them in my MV resource thread.

Forum statistics

Threads
105,512
Messages
1,014,337
Members
137,198
Latest member
mmc1980
Top