Exemplo n.º 1
0
    protected virtual void OnInitialize()
    {
        //IL_009d: Unknown result type (might be due to invalid IL or missing references)
        //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
        //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
        //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
        //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
        //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
        //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
        //IL_00dd: Unknown result type (might be due to invalid IL or missing references)
        opponentMem           = new OpponentMemory(this);
        targetCtrl            = new TargetController(this);
        moveCtrl              = new MoveController(this);
        weaponCtrl            = new WeaponController(this);
        opponentMemSpanTimer  = new SpanTimer(param.thinkParam.opponentMemorySpan);
        targetUpdateSpanTimer = new SpanTimer(param.thinkParam.targetUpdateSpan);
        _frontTransform       = GetFront();
        _backTransform        = GetBack();
        rootInternalRedius    = param.sensorParam.internalRadius * GetScale();
        Vector2 val = frontPositionXZ - owner.positionXZ;

        rootFrontDistance = val.get_magnitude() - rootInternalRedius;
        Vector2 val2 = backPositionXZ - owner.positionXZ;

        rootBackDistance = val2.get_magnitude() - rootInternalRedius;
    }
Exemplo n.º 2
0
    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);
    }