protected virtual int GetWeight(ActionInfo action, DISTANCE d, PLACE p) { int num = 0; int num2 = action.data.distanceWeights[(int)d]; int num3 = action.data.placeWeights[(int)p]; num = num2 * num3; if (brain.opponentMem.counter.nearNum >= 2) { num += action.data.nearMultiPlayerWeight; } return(num); }
IEnumerator Check() { while (true) { distance = DISTANCE.far; if (Vector3.Distance(target.position, transform.position) < Almost) { distance = DISTANCE.almost; } if (Vector3.Distance(target.position, transform.position) < Near) { distance = DISTANCE.near; } GetComponent <Animator>().SetInteger("distance", (int)distance); GetComponent <Animator>().SetInteger("emotion", (int)emotion); GetComponent <Animator>().SetInteger("health", (int)health); yield return(new WaitForSeconds(1)); } }
public override void HandleEvent(BRAIN_EVENT ev, object param = null) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) switch (ev) { case BRAIN_EVENT.END_ACTION: if (base.opponentMem != null) { base.opponentMem.Update(); } break; case BRAIN_EVENT.OWN_ATTACK_HIT: if (base.opponentMem != null) { OpponentMemory.OpponentRecord opponentRecord = base.opponentMem.Find(param as StageObject); if (opponentRecord != null) { opponentRecord.record.isDamaged = true; } } break; case BRAIN_EVENT.ATTACKED_HIT: { AttackedHitStatusOwner attackedHitStatusOwner2 = (AttackedHitStatusOwner)param; if (base.opponentMem != null) { OpponentMemory opponentMem2 = base.opponentMem; Vector3 val2 = attackedHitStatusOwner2.fromPos - attackedHitStatusOwner2.hitPos; DISTANCE distance2 = opponentMem2.GetDistance(val2.get_sqrMagnitude()); int num = (int)((float)attackedHitStatusOwner2.damage * base.opponentMem.hateParam.distanceAttackRatio[(int)distance2]); if (isNPC(attackedHitStatusOwner2.fromObject)) { num = (int)((float)num * 0.5f); } base.opponentMem.AddHate(attackedHitStatusOwner2.fromObject, num, Hate.TYPE.Damage); } break; } case BRAIN_EVENT.ATTACKED_WEAK_POINT: { AttackedHitStatusOwner attackedHitStatusOwner = (AttackedHitStatusOwner)param; if (base.opponentMem != null) { int attackedWeakPointHate = base.opponentMem.hateParam.attackedWeakPointHate; OpponentMemory opponentMem = base.opponentMem; Vector3 val = attackedHitStatusOwner.fromPos - attackedHitStatusOwner.hitPos; DISTANCE distance = opponentMem.GetDistance(val.get_sqrMagnitude()); attackedWeakPointHate = (int)((float)attackedWeakPointHate * base.opponentMem.hateParam.distanceAttackRatio[(int)distance]); if (isNPC(attackedHitStatusOwner.fromObject)) { attackedWeakPointHate = (int)((float)attackedWeakPointHate * 0.5f); } base.opponentMem.AddHate(attackedHitStatusOwner.fromObject, attackedWeakPointHate, Hate.TYPE.SpecialDamage); } break; } case BRAIN_EVENT.PLAYER_HEAL: if (base.opponentMem != null) { Player.HateInfo hateInfo2 = param as Player.HateInfo; base.opponentMem.AddHate(hateInfo2.target, hateInfo2.val, Hate.TYPE.Heal); } break; case BRAIN_EVENT.PLAYER_SKILL: if (base.opponentMem != null) { base.opponentMem.AddHate(param as StageObject, base.opponentMem.hateParam.skillHate, Hate.TYPE.Skill); } break; case BRAIN_EVENT.REVIVE_REGION: if (actionCtrl != null) { actionCtrl.OnReviveRegion((int)param); } break; case BRAIN_EVENT.DECOY: if (base.opponentMem != null) { DecoyBulletObject.HateInfo hateInfo = param as DecoyBulletObject.HateInfo; base.opponentMem.AddHate(hateInfo.target, hateInfo.value, hateInfo.type); } break; case BRAIN_EVENT.WAVE_TARGET: if (base.opponentMem != null) { base.opponentMem.AddHate(param as StageObject, 1000, Hate.TYPE.Damage); } break; } base.HandleEvent(ev, param); }