mag decrease stat check #25

Open
opened 2021-06-13 23:51:30 -04:00 by andy · 4 comments
Collaborator

this might already be handled.
if an item decreases a mag's stats, it will only happen if the amount to decrease <= current value (based on gc)

this might already be handled. if an item decreases a mag's stats, it will only happen if the amount to decrease <= current value (based on gc)
Owner

is this about stopping a mag from de-leveling? cause thats already in

is this about stopping a mag from de-leveling? cause thats already in
Author
Collaborator

If a mag has 6 exp in the Def and you feed it an item that removes more than 6 exp it will remain at 6 exp.

If a mag has 6 exp in the Def and you feed it an item that removes more than 6 exp it will remain at 6 exp.
Owner

src/entity/item/mag.rs Lines 1015 to 1033 in d66a90c4cf
pub fn feed(&mut self, tool: ToolType) {
let previous_level = self.level();
MAG_STATS.get(&self.mag).map(|stats| {
MAG_FEEDING_TABLES.get(stats.feed_table).map(|feeding_table| {
feeding_table.get(&tool).map(|feed_stats| {
self.def = std::cmp::max(std::cmp::max((self.def as i16) + feed_stats.def, 0) as u16, self.def()*100);
self.pow = std::cmp::max(std::cmp::max((self.pow as i16) + feed_stats.pow, 0) as u16, self.pow()*100);
self.dex = std::cmp::max(std::cmp::max((self.dex as i16) + feed_stats.dex, 0) as u16, self.dex()*100);
self.mnd = std::cmp::max(std::cmp::max((self.mnd as i16) + feed_stats.mnd, 0) as u16, self.mind()*100);
self.iq = std::cmp::min(((self.iq as i16) + feed_stats.iq as i16) as u8, 200);
self.synchro = std::cmp::min(((self.synchro as i8) + feed_stats.syn) as u8, 120);
})
})
});
//if previous_level != self.level() {
self.change_mag_type(previous_level);
self.assign_photon_blast();
//}
}

current functionality is to clamp it down:

for example 6 - 7 currently sets it to 0, when it should instead leave it at 6

http://git.sharnoth.com/jake/elseware/src/commit/d66a90c4cf7f712ea31bd835d8a24a1ec6eedfb2/src/entity/item/mag.rs#L1015-L1033 current functionality is to clamp it down: for example 6 - 7 currently sets it to 0, when it should instead leave it at 6
jake added the
release
label 2021-12-30 16:29:41 -05:00
Author
Collaborator
http://git.sharnoth.com/jake/elseware/pulls/140
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jake/elseware#25
No description provided.