Damage Floor and Elemental Armor

So, I am wanting to make a poison area and a lava area in my world map, but I want it so they take less floor damage when wearing specific armor that give them resistance to fire element and poison type damage. How would I go at doing this? I am using rpg maker mv. Any help is appreciated. Thanks.

You might be able to do something with this.

With the basic features it only lets you set up the damage amount and color. But with the “lunatic mode” or whatever these kids call these things today you should be able to run a custom formula that takes into account a character’s element resistance.

I appreciate the help. Had another question. How do I make it so the poison swamp tile randomly poisons a party member when they walk around on it? I want it so a party member gets poison status, but it only happens like 15% of the time (Unless they have armor that makes them immune to poison effect).

You can event it. If you want something more robust, there are plugs that assign events to region IDs.

Region ID, or Terrain ID, or even Tile ID (but that’s a little harder to look up.)
The basic floor damage formula is just a flat 10 dmg every step. I always thought that was impractical. You can set the floor damage rate as a special parameter in the actor or equipment traits list. But if your characters are walking around with HP in the thousands, changing a piece of equipment to save a few single digits every step doesn’t feel worth it.
Of course. You can change it in the rpg_objects.js(MV) or rmmc_objects.js(MZ) core scripts.

From there you can also add conditions to distinguish tiles by terrain tag. (Or region Id, or Tile ID, there’s a lot of ways to do it.) So Lava and Poison can deal different damage, based on the tile id or equipped Armor ids. I sorta tested this, just make sure you id all the floor tiles correctly. :man_facepalming:

Image

Game_Actor.prototype.basicFloorDamage = function() {
	let damage = 10;
	const terrainTag = $gameMap.terrainTag($gamePlayer.x, $gamePlayer.y);
	const FireResistArmorIds = [24, 25, 26];
	const PoisonResistArmorIds = [12, 13];

	if (terrainTag === 2) {//Lava
		const hasFireBoots = this.armors().some(item => item && FireResistArmorIds.includes(item.id));
		damage = hasFireBoots ? 25 : 50;
		//console.log("Lava damage")
	} else if (terrainTag === 3) {//Poison
		const hasPoisonBoots = this.armors().some(item => item && PoisonResistArmorIds.includes(item.id));
		damage = hasPoisonBoots ? 0 : 15;
		//console.log("Poison damage")
	}

	return damage;
};

There is another function that executes the floor damage. So to add a chance to inflict a poison state, You could add another conditional if statement like

if (terrainTag === 3 && Math.random() < 0.15) {
    this.addState(4);
};
2 Likes