owly
Banned
- Nov 26, 2020
- 179
Java:
package chobit;
public class DiTglrSkill extends DISkill {
private Boolean alive = true;
private String conjuration = "";
public DiTglrSkill(Kokoro kokoro,String conjuration) {
super(kokoro);
this.conjuration = conjuration;
}
@Override
public void input(String ear, String skin, String eye) {
//toggle :
String meirei = this.kokoro.toHeart.getOrDefault(conjuration, "");
if(meirei.contains(conjuration +" off")) {this.alive=false;this.kokoro.toHeart.remove(conjuration);return;}
if(meirei.contains(conjuration +" on")) {this.alive=true;this.kokoro.toHeart.remove(conjuration);return;}
//engage :
if(alive) {
super.input(ear, skin, eye);}
}
@Override
public void output(Neuron noiron) {
if(alive) {
super.output(noiron);}
}
}