public byte modifiedCatchRate(ItemBait aItem) { //(3 × HPmax - 2 × HPcurrent) × (rate × bonusball) / (3 × HPmax) + bonusstatus float bonusValues = 0f; if((this.StatusEffects&EStatusEffects.Burn)==EStatusEffects.Burn) bonusValues += 5f; if((this.StatusEffects&EStatusEffects.Confusion)==EStatusEffects.Confusion) bonusValues += 2.5f; if((this.StatusEffects&EStatusEffects.Freeze)==EStatusEffects.Freeze) bonusValues += 10f; if((this.StatusEffects&EStatusEffects.Paralyze)==EStatusEffects.Paralyze) bonusValues += 10f; if((this.StatusEffects&EStatusEffects.Poison)==EStatusEffects.Poison) bonusValues += 2.5f; if((this.StatusEffects&EStatusEffects.Sleep)==EStatusEffects.Sleep) bonusValues += 10f; int catchRate = monsterBreedRef.catchRate; float ballStrength = aItem.ballStrength; float catchRateAsFloat = catchRate; float dividedBallStrength = ballStrength; float mulitpliedCatchBall = catchRateAsFloat*dividedBallStrength; if(mulitpliedCatchBall<1f) { mulitpliedCatchBall = 1f; } else if(mulitpliedCatchBall>1000f) { mulitpliedCatchBall = 1000f; } float rate = (3 * MaxHP - 2 * hp) * (mulitpliedCatchBall) / (3 * MaxHP) + bonusValues; if(rate>255) { return byte.MaxValue; } if(rate<0) { return 0; } return Convert.ToByte(rate); }
public void setMovesToUseBait(ItemBait aItem,EMonsterCatchResult aResult) { _usingBait = aItem; _baitResult = aResult; BetterList<BattleMonster> ms = this.monstersAsBattleMonster; for(int i = 0;i<ms.size;i++) { Debug.Log("Doing ms "+i); ms[i].setFutureMove(Byte.MaxValue,ETeamPosition.UnSet,EMonsterPos.Unset,false); } }
public MoveQueueItem(ItemBait aBait,EMonsterCatchResult aResult) { _forcedSpeed = float.MaxValue; _useThisMove = null; targetTeam = ETeamPosition.RightTeam; targetMonster = EMonsterPos.Unset; actionPosition = EMonsterPos.Unset; baitItem = aBait; baitResult = aResult; firstHit = true; }
protected void onBaitUsed(ItemBait aBaitItem) { }
protected override void onMonsterCaughtResult(ItemBait aItem,EMonsterCatchResult aResult) { base.onMonsterCaughtResult(aItem,aResult); BetterList<BattleMonster> ms = opponentTeam.monstersAsBattleMonster; BattleMonster b = ms[BattleConstants.FRONT_INDEX]; for(int i = 0;i<ms.size;i++) { if(ms[i].monster.restingStatus==ERestingStatus.Awake) { b = ms[i]; } } MonsterDataMain m = (MonsterDataMain) b.monster; m.onMonsterCaughtAttempt -= onMonsterCaughtResult; Debug.Log ("onMonsterCaughtResult: "+aResult); }
protected virtual void onMonsterCaughtResult(ItemBait aItem,EMonsterCatchResult aResult) { this.playersTeam.setMovesToUseBait(aItem,aResult); }