static public float GetTypechartModifier(Move sender, Mon receiver, out string message) { TYPECHART s = sender.type; TYPECHART r1 = receiver.type_1; TYPECHART r2 = receiver.type_2; float value = 1f; // 1 is neutral value = CalculateTable(s, r1); if (r2 != TYPECHART.NaN) { value -= CalculateTable(s, r2); } if (value > 1.0f) { message = "It's super effective!"; return(2.0f); } else if (value < 1.0f) { message = "It's not very effective..."; return(0.5f); } else { message = "It kinda works!"; return(1.0f); } }
public Move[] moves; // always size 4 public Mon(string name, MonRenderData renderData, Stats stats, TYPECHART type_1, TYPECHART type_2) { this.name = name; this.renderData = renderData; this.stats = stats; this.type_1 = type_1; this.type_2 = type_2; this.moves = new Move[4]; }
static public float CalculateTable(TYPECHART attacking, TYPECHART defending) { //if (attacking == TYPECHART.Fire) //{ // if (defending == TYPECHART.Water) // not effective // return 0.5f; // else if (defending == TYPECHART.Grass) // effective // return 2f; //} //else if (attacking == TYPECHART.Grass) //{ // if (defending == TYPECHART.Fire)//not effective // return 0.5f; // else if (defending == TYPECHART.Water) // return 2f; //} //else if (attacking == TYPECHART.Water) //{ // if (defending == TYPECHART.Grass)//not effective // return 0.5f; // else if (defending == TYPECHART.Fire) // return 2f; //} //else if (attacking == TYPECHART.Electric) //{ // if (defending == TYPECHART.Ground)//not effective // return 0.5f; // else if (defending == TYPECHART.Water) // return 2f; //} //else if (attacking == TYPECHART.Ground) //{ // if (defending == TYPECHART.Grass)//not effective // return 0.5f; // else if (defending == TYPECHART.Electric) // return 2f; //} return(1f); }
public Move(string name) { this.name = name; if (name.Equals("Dick Slam")) { this.pp = 40; this.damage = 77; this.acc = 100; this.type = TYPECHART.Robotic; this.asset_name = "shock"; this.move_type = MOVE_TYPE.Damage; this.moveDelegate = MoveDelegateBank.Shock; } if (name.Equals("Shock")) { this.pp = 40; this.damage = 10; this.acc = 75; this.type = TYPECHART.Robotic; this.asset_name = "shock"; this.move_type = MOVE_TYPE.Damage; this.moveDelegate = MoveDelegateBank.Shock; } else if (name.Equals("Discharge")) { this.pp = 30; this.damage = 20; this.acc = 100; this.type = TYPECHART.Robotic; this.asset_name = "discharge"; this.move_type = MOVE_TYPE.Damage; this.moveDelegate = MoveDelegateBank.Shock; } else if (name.Equals("Thunder")) { this.pp = 20; this.damage = 25; this.acc = 95; this.type = TYPECHART.Robotic; this.asset_name = "thunder"; this.move_type = MOVE_TYPE.Damage; this.moveDelegate = MoveDelegateBank.Shock; } else if (name.Equals("Lightning Bolt")) { this.pp = 15; this.damage = 30; this.acc = 90; this.type = TYPECHART.Robotic; this.asset_name = "lightning_bolt"; this.move_type = MOVE_TYPE.Damage; this.moveDelegate = MoveDelegateBank.Shock; } else if (name.Equals("Lightning")) { this.pp = 10; this.damage = 60; this.acc = 50; this.type = TYPECHART.Robotic; this.asset_name = "lightning"; this.move_type = MOVE_TYPE.Damage; this.moveDelegate = MoveDelegateBank.Shock; } }