Renamed the root package to fmon and added paralysis, burn, and sleep status effects

This commit is contained in:
James Daly
2019-06-02 17:40:40 -04:00
parent d13d5b3bf6
commit 40553d36b9
31 changed files with 378 additions and 195 deletions

View File

@@ -0,0 +1,171 @@
- name: 'brn'
id: 'brn'
num: 0
effectType: 'Status'
onModifyStat: |
if (stat == PAtk) {
1 \\ 2
} else {
1.frac
}
onStart: |
println(s"${mon} was burned!")
/*
if (sourceEffect && sourceEffect.id === 'flameorb') {
target.status = Status('brn', '[from] 'item': Flame Orb');
} else if (sourceEffect && sourceEffect.effectType === 'Ability') {
target.status = Status('brn', '[from] 'ability': ' + sourceEffect.name, '[of] ' + source);
} else {
target.status = Status('brn');
}*/
onEnd: |
println(s"${mon} was healed of its burn.")
onResidualOrder: 9
onResidual: |
mon.takeDamage(mon(Hp) / 16);
println(s"${mon} was hurt by its burn!")
- name: 'par'
id: 'par'
num: 0
effectType: 'Status'
onStart: |
println(s"${mon} was paralyzed!")
/*
if (sourceEffect && sourceEffect.effectType === 'Ability') {
this.add('-status', target, 'par', '[from] ability: ' + sourceEffect.name, '[of] ' + source);
} else {
this.add('-status', target, 'par');
}
*/
onEnd: |
println(s"${mon} is no longer paralyzed!")
onModifyStat: |
if (stat == Speed /* && !mon.hasAbility('quickfeet') */) {
1 \\ 2
} else {
1.frac
}
onBeforeMovePriority: 1
onBeforeMove: |
if (rng.chance(1, 4)) {
println(s"${mon} is fully paralyzed!")
false
} else {
true
}
- name: 'slp'
id: 'slp'
num: 0
effectType: 'Status'
onStart: |
if (sourceEffect && sourceEffect.effectType === 'Ability') {
this.add('-status', target, 'slp', '[from] ability: ' + sourceEffect.name, '[of] ' + source);
} else if (sourceEffect && sourceEffect.effectType === 'Move') {
this.add('-status', target, 'slp', '[from] move: ' + sourceEffect.name);
} else {
this.add('-status', target, 'slp');
}
// 1-3 turns
this.effectData.startTime = this.random(2, 5);
this.effectData.time = this.effectData.startTime;
onEnd: |
println(s"${mon} woke up!")
onBeforeMovePriority: 10
onBeforeMove: |
/*
if (pokemon.hasAbility('earlybird')) {
pokemon.statusData.time--;
}
*/
pokemon.statusData.time--;
if (pokemon.statusData.time <= 0) {
pokemon.cureStatus();
return;
}
/*
this.add('cant', pokemon, 'slp');
if (move.sleepUsable) {
return;
}
*/
return false;
- name: 'frz'
effectType: Status
id: frz
num: 0
onBeforeMove: |-
if (move.flags("defrost") || rng.chance(1, 5)) {
mon.cureStatus()
true
} else {
println(s"${mon} is completely frozen!")
false
}
onBeforeMovePriority: 10
onHit: |-
if (move.flags("thaws") || move.element === 'Fire' && move.category !== MoveType.Status) {
target.cureStatus()
}
onStart: |-
println(s"${mon} was frozen solid!")
/*
if (sourceEffect && sourceEffect.effectType === 'Ability') {
target.status = Status('frz', '[from] 'ability': ' + sourceEffect.name, '[of] ' + source);
} else {
target.status = Status('frz');
}
if (target.template.species === 'Shaymin-Sky' && target.baseTemplate.baseSpecies === 'Shaymin') {
target.formeChange('Shaymin', this.effect, true);
}
*/
onEnd: |-
println(s"${mon} thawed out.")
onModifyMove: |
if (move.flags("defrost")) {
mon.cureStatus()
}
- name: 'psn'
id: 'psn'
num: 0
effectType: 'Status'
onStart: |
println(s"${mon} was poisoned!")
/*
if (sourceEffect && sourceEffect.effectType === 'Ability') {
this.add('-status', target, 'psn', '[from] ability: ' + sourceEffect.name, '[of] ' + source);
} else {
this.add('-status', target, 'psn');
}
*/
oneEnd: |
println(s"${mon} was cured of its poison.")
onResidualOrder: 9
onResidual: |
mon.takeDamage(mon(Hp) / 8);
println(s"${mon} was damaged by poison!")
- name: 'tox'
id: 'tox'
num: 0
effectType: 'Status'
onStart: |
this.effectData.stage = 0;
if (sourceEffect && sourceEffect.id === 'toxicorb') {
this.add('-status', target, 'tox', '[from] item: Toxic Orb');
} else if (sourceEffect && sourceEffect.effectType === 'Ability') {
this.add('-status', target, 'tox', '[from] ability: ' + sourceEffect.name, '[of] ' + source);
} else {
this.add('-status', target, 'tox');
}
onSwitchIn: |
this.effectData.stage = 0;
onResidualOrder: 9
onResidual: |
if (this.effectData.stage < 15) {
this.effectData.stage++;
}
this.damage(this.clampIntRange(pokemon.maxhp / 16, 1) * this.effectData.stage);