public bool addChoosableAction(WeaponAction newAction) { for (int i = 0; i < Globals.ACTION_LIMIT; i++) { if (itsChoosableActions[i].is_empty) { itsChoosableActions[i] = newAction; itsChoosableActions[i].is_empty = false; return true; } } return false; }
public WeaponAction copy(WeaponAction wep) { WeaponAction copyWeaponAction =(WeaponAction)base.copy(wep); if (isInitialized()) { copyWeaponAction.itsName = this.itsName; copyWeaponAction.itsChecks = new checkList[this.itsChecks.Length]; for (int i = 0; i < this.itsChecks.Length; i++) copyWeaponAction.itsChecks[i] = this.itsChecks[i].copy(); for (int i = 0; i < itsEffectLists.Length; i++) { for (int j = 0; j < itsEffectLists[i].Length; j++) copyWeaponAction.itsEffectLists[i][j] = this.itsEffectLists[i][j].copy(); } } return copyWeaponAction; }
public bool addAction(WeaponAction newAction) { itsActions.Add(newAction); return false; }
private void initializeLists() { /* Set all chances to 0, so that initially no action will automatically * be called after any other */ for (int i = 0; i < Globals.ACTION_LIMIT; i++) { for (int j = 0; j < Globals.ACTION_LIMIT; j++) itsSubActions[i, j] = 0; } target_Users = new bool[Globals.ACTION_LIMIT]; for (int j = 0; j < Globals.ACTION_LIMIT; j++) { target_Users[j] = false; } for (int j = 0; j < Globals.ACTION_LIMIT; j++) { itsChoosableActions[j] = new WeaponAction(); } }
public bool setSubActionChance(WeaponAction First, WeaponAction Second, int Chance) { int i = actionIndex(First.itsName); int j = actionIndex(Second.itsName); if (i < Globals.ACTION_LIMIT && j < Globals.ACTION_LIMIT && Chance>=0 && Chance <=100) { itsSubActions[i, j] = Chance; return true; } else return false; }
public bool removeChoosableAction(WeaponAction oldAction) { int i = choosableActionIndex(oldAction.itsName); if (i < Globals.ACTION_LIMIT) { itsChoosableActions[i].is_empty = true; return true; } else return false; }