void Test() { count++; c = LGstatData.CharacterGen (); text.text = LGstatData.CharacterGen ().ToString(); string output = string.Format("AVERAGES OUT OF {0} GEN ",count); for (int i = 0; i < (int)LGstatData.TraitType.COUNT; i++) { totals [i] += c.GetTrait( (LGstatData.TraitType)i); output+=(string.Format ("- {0} : {1} ", (LGstatData.TraitType)i, totals[i]/count)); } avText.text = output; }
// TODO: Add in Exhaustion Logic/removing characters from fights public bool CanUseSkill(LGcharacter toCheck) { int energy = toCheck.GetStat (LGstatData.StatusType.ENERGY); int energyDiff = 0; if (RNGesus.AttemptRoll (energy, _effortCost, out energyDiff, 3, 3)) { return true; } else { // On failed roll, lower energy value by one, collapse if you can't if (toCheck.AddStat (LGstatData.StatusType.ENERGY, -1)) { // On critical failure, if you roll significantly lower than cost, // the move fails and does not get used, but takes up turn/costs energy if (energyDiff < -energy*3) { return false; } } else { Debug.Log (string.Format("{0} Collapsed", toCheck.Name)); //TODO: Actually handle character collapse, removal from fight. return false; } } return true; }
public bool TriggerSkill(LGcharacter user, LGcharacter target, out bool didCrit) { didCrit = false; int diff = 0; if (RNGesus.AttemptRoll (user.GetTrait (_sourceTrait), target.GetTrait (_targetTrait), out diff)) { // HIT return true; } // MISS return false; }