THIS SITE IS INCOMPLETE
This the States Tab in RPG Maker's Database. It is comprised of 5 parts.
General Settings contain a bunch of settings that OMORI doesn't use. Just input the name you want to refer to the state as.
Removal Conditions determine how states are removed.
Almost all states are removed at the end of battle so enable that.
Remove by Restriction works in tandem with the Restriction setting, which isn't used in OMORI.
Auto-Removal Timing is how states are removed after a determined amount of turns. It's pretty self-explanatory.
Remove by Damage and Walking both are not used in OMORI.
Messages display text in the battle box when the conditions are met. This can also be done with Notes Coding.
Traits are where most stat changes are made. Refer to the next section for more info.
Notes allow you to add JavaScript to your state. This is mainly used for Emotions.
Traits are modifiers placed onto the actor/enemy inflicted with the state. You can add as many as you like in one state. A * indicates the trait is not used in OMORI.
Element Rate: A percentage based multiplier on the damage taken from the element listed. This is used mainly for Emotions.
*Debuff Rate: Changes the probability that a skill or item will debuff the listed stat.
*State Rate: Changes the probability that a skill or item will inflict the listed state.
State Resist: Become immune to the listed state.
Parameter: A percentage based multiplier on the listed stat.
Ex-Parameter: A percentage based adder on the listed stat.
Sp-Parameter: A percentage based multiplier on the listed stat.
Attack Element: Adds the listed element to any skills used. Mainly used for Emotions.
*Attack State: A percentage based chance that an attack will add the listed state.
*Attack Speed: A speed boost added to any skill used.
*Attack Times +: Repeats the skill used. So +1 makes the skill happen twice.
*Add Skill Type: Adds the listed skill type to the available skills. This doesn't really apply to OMORI
Seal Skill Type: Seals use of the listed skill type. Only really used by afraid.
*Add Skill: Learn the skill listed. This is done through troop events in OMORI.
*Seal Skill: Seals use of listed skill. Works fine it's just not used in OMORI.
*Equip Weapon: Unlocks the inputted weapon type. This would allow for characters to equip each other's weapons if out of battle.
*Equip Armor: Unlocks the inputted armor type. All of OMORI's charms except for FA Kel's Pet Rock are the same type.
*Lock Equip: Locks the inputted equipment type. This means you can't change your equipment while the state is active. This is used by all of Omori and Sunny's weapons.
*Seal Equip: Seals the inputted equipment type.
*Slot Type: Meant for dual-wielding. Doesn't work in OMORI.
*Action Times +: A percentage based chance that an actor will execute a command a second time. These can stack.
*Special Flag: Applies effects that don't work in OMORI.
*Collapse Effect: Determine the death animation. Doesn't work in OMORI. That is handled in the enemy Notes tab.
Party Ability: Adds a party wide ability. Only Gold Double and Item Drop Double work and only Gold Double is used.
This section will go over how emotions are set up. Note that if you are adding new emotions, it is worth knowing that you will have to modify 1(2 if enemies can also be affected) JavaScript Files.
This is the State for the Ecstatic emotion.
First we will look at the traits, as they are the easy part of this.
The traits have 3 parts.
The stat changes. For Ecstatic, these are the Hit Rate, Luck, and Speed modifiers. Every emotion should have at least 1 positive and negative stat change.
Elemental typing. In RPG Maker you set the resistances and weaknesses for elements.
First you should set the attack element to the emotion, making all attacks from the character be the emotions element.
Then, add the Element Rate for the resistance, which in this case is angry. Set it to the correct percentage listed below.
Finally, add the Element Rate for the weakness, which in this case is sad. Also do this for the Emotion element. It's used for only one attack by the Snow Angel but you can use it too.
State Resistances. Make your state resistant the lower tiers of its emotion. So for Ecstatic we are resistant to basic happy.
And presto we have 1 of three parts of our emotion done!
Also this is how Buffs and Debuffs are also set up, excluding the elemental stuff.
Next step, the Notes coding. Which actually is really easy for emotions.
<TransformEmotion: happy>
//GRAPHICS
<StateFaceIndex: 2>
<StateBackIndex: 3>
<StateListIndex: 4>
<BattleLogType:ECSTATIC>
//STATE CATEGORIES
<Category: EMOTION>
<Category: HAPPY>
<Custom Apply Effect>
user.removeStateCategoryAll("SAD")
user.removeStateCategoryAll("ANGRY")
user.removeStateCategoryAll("AFRAID")
user.result().removedStates = user.result().removedStates.filter(s => !user._isEmotionalState(s))
</Custom Apply Effect>
Here are the Notes for Ecstatic. We'll go step-by-step.
The blue line is used for enemies. It determines what form they will transform into when having this emotion. This is better detailed in the enemies page, but every enemy has a separate slot for each emotion. This is what determines which slot to turn into.
The green lines are used for the graphical aspects of the emotion. These are mentioned in the sprites page, but these are the party portraits, background gradient, and emotion name, in that order. The faces and name are indexed from 0 going top-to-bottom. The Background is indexed from 0 going left-to-right, top-to-bottom.
The Yellow line is used to call for the battle text.
This can be substituted with eval: BattleManager._logWindow.push("addText", `dialogue here`) with ${target.name()} and ${user.name()} being subsituted with the target and user in the dialogue.
The Purple lines categorize the emotion for use in other JavaScript.
The Red lines remove other emotions.
Lastly is two bits of plugin modification. I have never seen a mod use these before, and in fact I had to discover this on my own, so be warned this is likely buggy.
To mod JavaScript files, we can't simply patch over them like other file types, well we can, but they can't be patched by OneLoader. (At least that's what I've been told. Besides this method is cleaner.)
Instead we make new JavaScript files to overwrite the code. So make a new JavaScript file,(This can easily be done by copy pasting any of the "Header files" like ------------------.js) and then add these two bits of code into your file. These are modded versions of existing code, so when loaded in game, these will overwrite the original files.
JavaScript
//=============================================================================
// REFRESH ENEMY EMOTIONS from Omori BASE.js
// What this code does is it defines what Emotions can be felt by Enemies, and what slot each emotion should use. The emotion states reference this code with <TransformEmotion: emotion> with emotion being one of the cases listed in the purple. The cyan 'new' case is a demonstration of how to add more emotions. So if I put <TransformEmotion: new> on a state and give it to an enemy, it will transform into the enemy for slots ahead of its neutral form in the Database.
// tl;dr 'text like this' can be put in <TransformEmotion: emotion> on states and these lines do that work. Add more cyan lines for all emotions you want to add.
//=============================================================================
Game_Enemy.prototype.refreshEmotionStateTransform = function() {
// If Not Dead
if (!this.isDead() && !this._isStateTransforming) {
// Get Emotion
var emotion = this.getStateEmotion();
// Get base Id
var baseId = this.enemy().meta.TransformBaseID;
// Set Base ID
baseId = baseId ? Number(baseId) : this._enemyId;
// Set Transform ID
var transformId = this._enemyId;
// Switch Case Emotion
switch (emotion) {
case 'normal': transformId = baseId ;break;
case 'happy': transformId = baseId + 1 ;break;
case 'sad': transformId = baseId + 2 ;break;
case 'angry': transformId = baseId + 3 ;break;
case 'new': transformId = base Id + 4 ;break;
break;
};
// If Transform Id
if (transformId !== this._enemyId) {
this._isStateTransforming = true;
if(this.name() === "SPACE EX-HUSBAND") {
$gameScreen.setFlashWait(60)
$gameScreen.startFlash([255,255,255,255], 130)
}
this.transform(transformId)
this._isStateTransforming = false;
};
};
};
//-----------------------------------------------------------------------------
// EMOTION ELEMENTAL FIXES from YIN_OmoriFixes.js
// What this code does is it controls what states are emotions and uses that for moving and dull attacks. So in order to have new emotions work with that system, we must add them here. Once again cyan is new code that you can replace x, y, and z with the ids of the three tiers of your new emotion. In case you're wondering, the states for Sxbf, Sweetheat, and the Twins are special versions of their 2nd and 3rd tier emotions.
// tl;dr Replace x y and z with your new emotion ids so Moving and Dull attacks work.
//-----------------------------------------------------------------------------
Game_Action.prototype.calcElementRate = function(target) {
/*if (this.item().damage.elementId < 0) {
return this.elementsMaxRate(target, this.subject().attackElements());
} else {*/
// YIN Instead of bypassing the subject's attack element, we want to use it if they are inflicted with an emotion.
// If elementId == None or Normal Attack
if (this.item().damage.elementId < 1) {
// These are all base emotion states (non afraid)
var emotionStates = [6, 7, 8, 10, 11, 12, 14, 15, 16];
emotionStates = [...emotionStates, 119,120,121]; // Space Ex Boyfriend
emotionStates = [...emotionStates, 122,123,197]; // Sweetheart
emotionStates = [...emotionStates, 124,125,126]; // Unbread Twins
emotionStates = [...emotionStates, x,y,z]; // New Emotions
// Search states for emotion states
var emotionAfflicted;
this.subject()._states.forEach(function(stateId) {
// Do we have an emotion state on us?
if (emotionStates.contains(stateId)) {
emotionAfflicted = true;
}
}, this);
if (emotionAfflicted) {
return target.elementRate(this.subject().attackElements()[0]); // If so, that is our attack element
} else {
return target.elementRate(this.item().damage.elementId);
}
} else {
return target.elementRate(this.item().damage.elementId);
}
//}
};