Script for decreasing Pokemon's stats for every (few) step(s) that you take

Dark

Rookie
Member
Joined
Apr 24, 2018
Posts
7
Im new to this site and skripting so sorry if the request is something that isnt doable - im a total noob... but anyways:
i was thinking of implenting a food system thats based on a pokemon's weight. so if a pokemon is heavier its stats and hp would decrease overtime for every few steps u take. the havier the mon the quicker the fewer steps ud have to run for the mon's stats to decrease.

i thought this would be a nice addition to the games in general cuz its usually common that u just choose stronger mons (that tend to be havier) over the small weaker ones because....well they stronger...
but if these big mons require copious amounts of food (say...apricorns or something of that sort) to stay at their maximum capacity - and food might be scarce or expensive - then one maybe would choose a smaller, weaker, "less hungry" mon to be in their team in place of a very big strong mon instead.

i had no specific idea how the weight would scale with food intake since the food doesnt even exist and all these things - but i thought it would be nice to have this thread here going so ppl may come up with nice ideas that someone else or me could use at a later point as reference

thanks for helping :)
 

MGriffin

Trainer
Member
Joined
May 8, 2017
Posts
95
Seems like it should be easy enough, Essentials must already have code that triggers each step for hatching eggs and dealing poison damage in the overworld.

1. Find that code, and add some lines to increase hunger for each Pokémon proportional to its weight. You can get the weight data for a Pokémon by using pbGetDexData, see PokeBattle_Pokemon for some examples.
2. You can define hunger in PokeBattle_Pokemon, and change the stats from being attr_accessors to actual functions that look something like (assuming hunger starts at 0 and is always less than 1):
Code:
def attack
  return @attack * (1-@hunger)
end
3. To add food items you can look at the code for something like Potion, and edit it so that instead of increasing hp it decreases hunger.
 

Dark

Rookie
Member
Joined
Apr 24, 2018
Posts
7
Seems like it should be easy enough, Essentials must already have code that triggers each step for hatching eggs and dealing poison damage in the overworld.

1. Find that code, and add some lines to increase hunger for each Pokémon proportional to its weight. You can get the weight data for a Pokémon by using pbGetDexData, see PokeBattle_Pokemon for some examples.
2. You can define hunger in PokeBattle_Pokemon, and change the stats from being attr_accessors to actual functions that look something like (assuming hunger starts at 0 and is always less than 1):
Code:
def attack
  return @attack * (1-@hunger)
end
3. To add food items you can look at the code for something like Potion, and edit it so that instead of increasing hp it decreases hunger.

i really gotta get into this stuff
u make it sound so easy
i wanna know how to solve these problems myself in the future Kreygasm
 
Top