Beispiel #1
0
 public void OnHitAttack(AttackHitInfo info, AttackHitColliderProcessor.HitParam hit_param)
 {
     if (m_attackHitChecker != null)
     {
         m_attackHitChecker.OnHitAttack(info, hit_param);
     }
 }
Beispiel #2
0
 public void OnHitAttack(AttackHitInfo info, AttackHitColliderProcessor.HitParam hit_param)
 {
     //IL_007a: Unknown result type (might be due to invalid IL or missing references)
     //IL_007f: Unknown result type (might be due to invalid IL or missing references)
     //IL_0084: Unknown result type (might be due to invalid IL or missing references)
     //IL_0090: Unknown result type (might be due to invalid IL or missing references)
     //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
     //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
     //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
     //IL_00b3: Unknown result type (might be due to invalid IL or missing references)
     if (attackHitChecker != null)
     {
         attackHitChecker.OnHitAttack(info, hit_param);
     }
     if (isCharacterHitDelete && hit_param.toObject is Character)
     {
         isLandHitDelete = false;
         OnDestroy();
     }
     else if ((isCharacterHitDelete || !isShotArrow) && isObjectHitDelete)
     {
         isLandHitDelete = true;
         landHitPosition = Utility.ClosestPointOnCollider(hit_param.toCollider, prevPosition);
         landHitRotation = _transform.get_rotation() * Quaternion.Euler(new Vector3(-90f, 0f, 0f));
         _rigidbody.Sleep();
     }
 }
    public bool CheckHitAttack(AttackHitInfo info, Collider to_collider, StageObject to_object)
    {
        List <HitRecord> list = attackHitList.Get(info.name);

        if (list != null)
        {
            int i = 0;
            for (int count = list.Count; i < count; i++)
            {
                HitRecord hitRecord = list[i];
                if (hitRecord.target == to_object)
                {
                    if (info.enableIdentityCheck)
                    {
                        return(false);
                    }
                    if (Time.get_time() - hitRecord.lastHitTime <= info.hitIntervalTime)
                    {
                        return(false);
                    }
                }
            }
        }
        return(true);
    }
 public virtual void GetAtk(AttackHitInfo info, ref AtkAttribute atk)
 {
     if (info != null)
     {
         atk.Add(info.atk);
     }
 }
    public static AtkAttribute CalcEnemyATK(EnemyAtkCalcData calcData)
    {
        AtkAttribute  atkAttribute = new AtkAttribute();
        AttackHitInfo atkInfo      = calcData.atkInfo;

        if (atkInfo != null)
        {
            atkAttribute.Add(atkInfo.atk);
        }
        AtkAttribute atkAttribute2 = new AtkAttribute();

        atkAttribute2.Set(0f);
        atkAttribute2.Add(calcData.buffAtkRate);
        AtkAttribute atkAttribute3 = new AtkAttribute();

        atkAttribute3.Copy(atkAttribute);
        atkAttribute3.Mul(atkAttribute2);
        atkAttribute.Add(atkAttribute3);
        atkAttribute.Add(calcData.buffAtkConstant);
        if (calcData.buffAtkAllElementConstant > 0f)
        {
            atkAttribute.AddElementValueWithCheck(calcData.buffAtkAllElementConstant);
        }
        return(atkAttribute);
    }
    public void OnHitAttack(AttackHitInfo info, AttackHitColliderProcessor.HitParam hit_param)
    {
        List <HitRecord> list = attackHitList.Get(info.name);

        if (list == null)
        {
            list = new List <HitRecord>();
            attackHitList.Add(info.name, list);
        }
        HitRecord hitRecord = null;
        int       i         = 0;

        for (int count = list.Count; i < count; i++)
        {
            if (list[i].target == hit_param.toObject)
            {
                hitRecord = list[i];
                break;
            }
        }
        if (hitRecord == null)
        {
            hitRecord        = new HitRecord();
            hitRecord.target = hit_param.toObject;
            list.Add(hitRecord);
        }
        hitRecord.lastHitTime = Time.get_time();
    }
Beispiel #7
0
    public virtual void Initialize(StageObject attacker, AttackInfo atkInfo, StageObject targetObj, Transform launchTrans, Vector3 offsetPos, Quaternion offsetRot)
    {
        //IL_0085: Unknown result type (might be due to invalid IL or missing references)
        //IL_008a: Expected O, but got Unknown
        //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
        //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
        //IL_00d1: 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_00ea: Unknown result type (might be due to invalid IL or missing references)
        //IL_00ef: Unknown result type (might be due to invalid IL or missing references)
        //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
        //IL_0107: Unknown result type (might be due to invalid IL or missing references)
        //IL_011d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0122: Expected O, but got Unknown
        //IL_012f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0140: Unknown result type (might be due to invalid IL or missing references)
        //IL_0145: 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_015c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0161: Expected O, but got Unknown
        m_attacker = attacker;
        m_atkInfo  = atkInfo;
        AttackHitInfo attackHitInfo = atkInfo as AttackHitInfo;

        if (attackHitInfo != null)
        {
            attackHitInfo.enableIdentityCheck = false;
        }
        BulletData bulletData = atkInfo.bulletData;

        m_landHitEffectName = bulletData.data.landHiteffectName;
        m_aliveTimer        = bulletData.data.appearTime;
        m_moveSpeed         = bulletData.data.speed;
        BulletData.BulletFunnel dataFunnel = bulletData.dataFunnel;
        m_aimAngleSpeed   = dataFunnel.lookAtAngle * 0.0174532924f;
        m_funnelData      = dataFunnel;
        m_isDeleted       = false;
        m_cachedTransform = this.get_transform();
        m_cachedTransform.set_parent((!MonoBehaviourSingleton <StageObjectManager> .IsValid()) ? MonoBehaviourSingleton <EffectManager> .I._transform : MonoBehaviourSingleton <StageObjectManager> .I._transform);
        m_cachedTransform.set_position(launchTrans.get_position() + launchTrans.get_rotation() * offsetPos);
        m_cachedTransform.set_rotation(launchTrans.get_rotation() * offsetRot);
        m_cachedTransform.set_localScale(bulletData.data.timeStartScale);
        Transform effect = EffectManager.GetEffect(bulletData.data.effectName, this.get_transform());

        effect.set_localPosition(bulletData.data.dispOffset);
        effect.set_localRotation(Quaternion.Euler(bulletData.data.dispRotation));
        effect.set_localScale(Vector3.get_one());
        m_effectObj      = effect.get_gameObject();
        m_effectAnimator = m_effectObj.GetComponent <Animator>();
        if (targetObj != null)
        {
            RequestMain(targetObj);
        }
        else
        {
            RequestSearch();
        }
    }
 public void OnHitCounterEnemy(AttackHitInfo attack_info)
 {
     if (player.weaponInfo != null)
     {
         float add_gauge = player.playerParameter.healSkillGaugeHit * player.playerParameter.ohsActionInfo.Common_CounterHealSkillRate;
         AddUseGauge(add_gauge, true, true);
     }
 }
 public override bool CheckHitAttack(AttackHitInfo info, Collider to_collider, StageObject to_object)
 {
     if (info.attackType == AttackHitInfo.ATTACK_TYPE.BOMBROCK && to_object is Player && !(to_object is Self))
     {
         return(false);
     }
     return(base.CheckHitAttack(info, to_collider, to_object));
 }
Beispiel #10
0
 public bool CheckHitAttack(AttackHitInfo info, Collider to_collider, StageObject to_object)
 {
     if (attackHitChecker != null && !attackHitChecker.CheckHitAttack(info, to_collider, to_object))
     {
         return(false);
     }
     return(true);
 }
 public override void Hit(AttackHitInfo hitInfo, Vector2 knockbackDirection)
 {
     base.Hit(hitInfo, knockbackDirection);
     this.aiState = AIState.AGGRO; // go aggro
     if (hitInfo.source != null)
     {
         target = hitInfo.source; // with the perpetrator as the target
     }
 }
 public void OnHitAttackEnemy(AttackHitInfo attack_info)
 {
     if (player.weaponInfo != null)
     {
         float num       = (!attack_info.toEnemy.isSpecialAttack) ? player.weaponInfo.healSkillGaugeHitRate : player.weaponInfo.healSkillGaugeHitRateSpecialAttack;
         float add_gauge = player.playerParameter.healSkillGaugeHit * num * attack_info.atkRate;
         AddUseGauge(add_gauge, true, true);
     }
 }
    public virtual void OnAttackedHit(AttackHitInfo info, AttackHitColliderProcessor.HitParam hit_param)
    {
        //IL_0049: Unknown result type (might be due to invalid IL or missing references)
        //IL_004e: Unknown result type (might be due to invalid IL or missing references)
        //IL_0055: Unknown result type (might be due to invalid IL or missing references)
        //IL_005a: Unknown result type (might be due to invalid IL or missing references)
        //IL_009d: Unknown result type (might be due to invalid IL or missing references)
        //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
        AttackedHitStatus attackedHitStatus = new AttackedHitStatus();

        attackedHitStatus.hitParam           = hit_param;
        attackedHitStatus.attackInfo         = info;
        attackedHitStatus.fromObjectID       = hit_param.fromObject.id;
        attackedHitStatus.fromObject         = hit_param.fromObject;
        attackedHitStatus.fromType           = hit_param.fromObject.objectType;
        attackedHitStatus.fromPos            = hit_param.fromObject._position;
        attackedHitStatus.hitPos             = hit_param.point;
        attackedHitStatus.distanceXZ         = hit_param.distanceXZ;
        attackedHitStatus.hitTime            = hit_param.time;
        attackedHitStatus.isSpAttackHit      = hit_param.isSpAttackHit;
        attackedHitStatus.attackMode         = hit_param.attackMode;
        attackedHitStatus.damageDistanceData = hit_param.damageDistanceData;
        attackedHitStatus.exHitPos           = hit_param.exHitPos;
        nowAttackedHitStatus = attackedHitStatus;
        if (MonoBehaviourSingleton <CoopManager> .IsValid())
        {
            attackedHitStatus.fromClientID = MonoBehaviourSingleton <CoopManager> .I.coopMyClient.clientId;
        }
        if (attackedHitStatus.fromType == OBJECT_TYPE.SELF)
        {
            attackedHitStatus.fromType = OBJECT_TYPE.PLAYER;
        }
        OnAttackedHitDirection(new AttackedHitStatusDirection(attackedHitStatus));
        if (IsValidAttackedHit(hit_param.fromObject) && !IsPuppet() && !hit_param.fromObject.IsPuppet())
        {
            OnAttackedHitLocal(new AttackedHitStatusLocal(attackedHitStatus));
            if (IsMirror() || IsPuppet())
            {
                if (packetSender != null)
                {
                    packetSender.OnAttackedHitOwner(new AttackedHitStatusOwner(attackedHitStatus));
                }
            }
            else if (IsEnableAttackedHitOwner())
            {
                OnAttackedHitOwner(new AttackedHitStatusOwner(attackedHitStatus));
                AttackedHitStatusFix status = new AttackedHitStatusFix(attackedHitStatus);
                OnAttackedHitFix(status);
                if (packetSender != null)
                {
                    packetSender.OnAttackedHitFix(status);
                }
            }
        }
    }
Beispiel #14
0
    public void Setup(Player owner, Transform trans, BulletData bullet, SkillInfo.SkillParam skill)
    {
        Initialize(owner, trans, (float)skill.supportValue[0], bullet.data.radius);
        intervalTime = bullet.dataZone.intervalTime;
        AttackHitInfo attackHitInfo = m_attackInfo as AttackHitInfo;

        if (attackHitInfo != null)
        {
            attackHitInfo.atkRate /= (float)Mathf.FloorToInt(skill.supportTime[0] / intervalTime);
        }
        targetCollection.Clear();
    }
    public override AttackInfo GetRateAttackInfo(AttackInfo rate_info, float rate)
    {
        AttackHitInfo attackHitInfo = base.GetRateAttackInfo(rate_info, rate) as AttackHitInfo;

        if (attackHitInfo == this)
        {
            return(attackHitInfo);
        }
        AttackHitInfo attackHitInfo2 = rate_info as AttackHitInfo;

        if (attackHitInfo2 == null)
        {
            return(attackHitInfo);
        }
        attackHitInfo.atkRate                    = AttackInfo.GetRateValue(atkRate, attackHitInfo2.atkRate, rate);
        attackHitInfo.atk.normal                 = AttackInfo.GetRateValue(atk.normal, attackHitInfo2.atk.normal, rate);
        attackHitInfo.atk.fire                   = AttackInfo.GetRateValue(atk.fire, attackHitInfo2.atk.fire, rate);
        attackHitInfo.atk.water                  = AttackInfo.GetRateValue(atk.water, attackHitInfo2.atk.water, rate);
        attackHitInfo.atk.thunder                = AttackInfo.GetRateValue(atk.thunder, attackHitInfo2.atk.thunder, rate);
        attackHitInfo.atk.soil                   = AttackInfo.GetRateValue(atk.soil, attackHitInfo2.atk.soil, rate);
        attackHitInfo.atk.light                  = AttackInfo.GetRateValue(atk.light, attackHitInfo2.atk.light, rate);
        attackHitInfo.atk.dark                   = AttackInfo.GetRateValue(atk.dark, attackHitInfo2.atk.dark, rate);
        attackHitInfo.isAtkIgnore                = isAtkIgnore;
        attackHitInfo.down                       = AttackInfo.GetRateValue(down, attackHitInfo2.down, rate);
        attackHitInfo.badStatus.paralyze         = AttackInfo.GetRateValue(badStatus.paralyze, attackHitInfo2.badStatus.paralyze, rate);
        attackHitInfo.badStatus.poison           = AttackInfo.GetRateValue(badStatus.poison, attackHitInfo2.badStatus.poison, rate);
        attackHitInfo.badStatus.burning          = AttackInfo.GetRateValue(badStatus.burning, attackHitInfo2.badStatus.burning, rate);
        attackHitInfo.badStatus.speedDown        = AttackInfo.GetRateValue(badStatus.speedDown, attackHitInfo2.badStatus.speedDown, rate);
        attackHitInfo.badStatus.attackSpeedDown  = AttackInfo.GetRateValue(badStatus.attackSpeedDown, attackHitInfo2.badStatus.attackSpeedDown, rate);
        attackHitInfo.shakeCameraPercent         = AttackInfo.GetRateValue(shakeCameraPercent, attackHitInfo2.shakeCameraPercent, rate);
        attackHitInfo.shakeCycleTime             = AttackInfo.GetRateValue(shakeCycleTime, attackHitInfo2.shakeCycleTime, rate);
        attackHitInfo.enableIdentityCheck        = enableIdentityCheck;
        attackHitInfo.hitEffectName              = ((!(rate < 1f)) ? attackHitInfo2.hitEffectName : hitEffectName);
        attackHitInfo.playCommonHitSe            = ((!(rate < 1f)) ? attackHitInfo2.playCommonHitSe : playCommonHitSe);
        attackHitInfo.hitSEID                    = ((!(rate < 1f)) ? attackHitInfo2.hitSEID : hitSEID);
        attackHitInfo.playCommonHitEffect        = ((!(rate < 1f)) ? attackHitInfo2.playCommonHitEffect : playCommonHitEffect);
        attackHitInfo.remainEffectName           = ((!(rate < 1f)) ? attackHitInfo2.remainEffectName : remainEffectName);
        attackHitInfo.damageNumAddGroup          = damageNumAddGroup;
        attackHitInfo.dontIncreaseGauge          = dontIncreaseGauge;
        attackHitInfo.attackType                 = ((!(rate < 1f)) ? attackHitInfo2.attackType : attackType);
        attackHitInfo.spAttackType               = ((!(rate < 1f)) ? attackHitInfo2.spAttackType : spAttackType);
        attackHitInfo.toPlayer.reactionType      = ((!(rate < 1f)) ? attackHitInfo2.toPlayer.reactionType : toPlayer.reactionType);
        attackHitInfo.toPlayer.reactionLoopTime  = AttackInfo.GetRateValue(toPlayer.reactionLoopTime, attackHitInfo2.toPlayer.reactionLoopTime, rate);
        attackHitInfo.toPlayer.reactionBlowForce = AttackInfo.GetRateValue(toPlayer.reactionBlowForce, attackHitInfo2.toPlayer.reactionBlowForce, rate);
        attackHitInfo.toPlayer.reactionBlowAngle = AttackInfo.GetRateValue(toPlayer.reactionBlowAngle, attackHitInfo2.toPlayer.reactionBlowAngle, rate);
        attackHitInfo.toEnemy.reactionType       = ((!(rate < 1f)) ? attackHitInfo2.toEnemy.reactionType : toEnemy.reactionType);
        attackHitInfo.toEnemy.hitStopTime        = AttackInfo.GetRateValue(toEnemy.hitStopTime, attackHitInfo2.toEnemy.hitStopTime, rate);
        attackHitInfo.toEnemy.hitTypeName        = ((!(rate < 1f)) ? attackHitInfo2.toEnemy.hitTypeName : toEnemy.hitTypeName);
        attackHitInfo.toEnemy.isSpecialAttack    = ((!(rate < 1f)) ? attackHitInfo2.toEnemy.isSpecialAttack : toEnemy.isSpecialAttack);
        return(attackHitInfo);
    }
    public void RequestDestroy()
    {
        //IL_002b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0045: Unknown result type (might be due to invalid IL or missing references)
        //IL_0055: Unknown result type (might be due to invalid IL or missing references)
        //IL_0065: Unknown result type (might be due to invalid IL or missing references)
        //IL_006a: Expected O, but got Unknown
        //IL_00d7: Unknown result type (might be due to invalid IL or missing references)
        //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
        //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
        //IL_00fc: Expected O, but got Unknown
        //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)
        //IL_0182: Unknown result type (might be due to invalid IL or missing references)
        //IL_019a: Unknown result type (might be due to invalid IL or missing references)
        if (MonoBehaviourSingleton <EffectManager> .IsValid())
        {
            Transform effect = EffectManager.GetEffect("ef_btl_enemy_explosion_01_02", base._transform);
            effect.set_localScale(new Vector3(0.8f, 0.8f, 0.8f));
        }
        if (MonoBehaviourSingleton <SoundManager> .IsValid())
        {
            SoundManager.PlayOneShotSE(30000102, _position);
        }
        m_modelTrans.get_gameObject().SetActive(false);
        GameObject           val = new GameObject("BombRockAttackToEnemy");
        BombRockAttackObject bombRockAttackObject = val.AddComponent <BombRockAttackObject>();
        AttackInfo           attackInfo           = MonoBehaviourSingleton <StageObjectManager> .I.self.GetAttackInfos().Find((AttackInfo info) => info.name == "bombrock");

        if (attackInfo != null)
        {
            AttackHitInfo attackHitInfo = attackInfo as AttackHitInfo;
            attackHitInfo.atk.normal = m_attackRate;
            bombRockAttackObject.Initialize(MonoBehaviourSingleton <StageObjectManager> .I.self, base._transform, attackHitInfo, Vector3.get_zero(), Vector3.get_zero(), 2f, 1f, 14);
        }
        GameObject           val2 = new GameObject("BombRockAttackToSelf");
        BombRockAttackObject bombRockAttackObject2 = val2.AddComponent <BombRockAttackObject>();
        AttackHitInfo        attackHitInfo2        = new AttackHitInfo();

        attackHitInfo2.attackType                 = AttackHitInfo.ATTACK_TYPE.BOMBROCK;
        attackHitInfo2.toPlayer.reactionType      = AttackHitInfo.ToPlayer.REACTION_TYPE.BLOW;
        attackHitInfo2.toPlayer.reactionBlowForce = 100f;
        attackHitInfo2.toPlayer.reactionBlowAngle = 20f;
        bombRockAttackObject2.Initialize(this, base._transform, attackHitInfo2, Vector3.get_zero(), Vector3.get_zero(), 2f, 1f, 15);
        if (!object.ReferenceEquals(m_effectBase, null))
        {
            Object.Destroy(m_effectBase.get_gameObject());
            m_effectBase = null;
        }
        this.StartCoroutine(ProcessDestroy());
    }
Beispiel #17
0
 public void Initialize(InitParamCannonBeam initParam)
 {
     //IL_0066: Unknown result type (might be due to invalid IL or missing references)
     //IL_006b: Expected O, but got Unknown
     //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
     //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
     //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
     //IL_0108: Unknown result type (might be due to invalid IL or missing references)
     //IL_010d: Unknown result type (might be due to invalid IL or missing references)
     //IL_011b: Unknown result type (might be due to invalid IL or missing references)
     //IL_0120: Expected O, but got Unknown
     //IL_013f: Unknown result type (might be due to invalid IL or missing references)
     //IL_0141: Unknown result type (might be due to invalid IL or missing references)
     if (initParam.atkInfo != null)
     {
         m_atkInfo = initParam.atkInfo;
         AttackHitInfo attackHitInfo = m_atkInfo as AttackHitInfo;
         if (attackHitInfo != null)
         {
             attackHitInfo.enableIdentityCheck = false;
         }
         BulletData bulletData = m_atkInfo.bulletData;
         if (!(bulletData == null))
         {
             BulletData.BulletBase data = bulletData.data;
             if (data != null)
             {
                 m_attacker        = initParam.attacker;
                 m_cachedTransform = this.get_transform();
                 m_cachedTransform.set_parent((!MonoBehaviourSingleton <StageObjectManager> .IsValid()) ? MonoBehaviourSingleton <EffectManager> .I._transform : MonoBehaviourSingleton <StageObjectManager> .I._transform);
                 Transform launchTrans = initParam.launchTrans;
                 m_cachedTransform.set_position(launchTrans.get_position());
                 m_cachedTransform.set_rotation(launchTrans.get_rotation());
                 m_cachedTransform.set_localScale(data.timeStartScale);
                 m_existTime    = data.appearTime;
                 m_hasExistTime = (data.appearTime > 0f);
                 float                  radius                 = data.radius;
                 float                  capsuleHeight          = data.capsuleHeight;
                 Vector3                hitOffset              = data.hitOffset;
                 int                    ignoreLayerMask        = 20736;
                 GameObject             val                    = new GameObject("CannonBeamAttackObject");
                 CannonBeamAttackObject cannonBeamAttackObject = val.AddComponent <CannonBeamAttackObject>();
                 cannonBeamAttackObject.Initialize(m_attacker, m_cachedTransform, m_atkInfo, hitOffset, Vector3.get_zero(), radius, capsuleHeight, 14);
                 cannonBeamAttackObject.SetIgnoreLayerMask(ignoreLayerMask);
                 m_attackObj = cannonBeamAttackObject;
                 Transform val2 = m_effectTrans = EffectManager.GetEffect(data.effectName, launchTrans);
             }
         }
     }
 }
    public override void Copy(ref AttackInfo rInfo)
    {
        base.Copy(ref rInfo);
        AttackHitInfo attackHitInfo = rInfo as AttackHitInfo;

        if (attackHitInfo != null)
        {
            attackHitInfo.atkRate                     = atkRate;
            attackHitInfo.isAtkIgnore                 = isAtkIgnore;
            attackHitInfo.down                        = down;
            attackHitInfo.shakeCameraPercent          = shakeCameraPercent;
            attackHitInfo.shakeCycleTime              = shakeCycleTime;
            attackHitInfo.enableIdentityCheck         = enableIdentityCheck;
            attackHitInfo.hitIntervalTime             = hitIntervalTime;
            attackHitInfo.hitEffectName               = hitEffectName;
            attackHitInfo.playCommonHitSe             = playCommonHitSe;
            attackHitInfo.hitSEID                     = hitSEID;
            attackHitInfo.playCommonHitEffect         = playCommonHitEffect;
            attackHitInfo.remainEffectName            = remainEffectName;
            attackHitInfo.absorptance                 = absorptance;
            attackHitInfo.isImmediateDeath            = isImmediateDeath;
            attackHitInfo.canAttackGrabbedPlayer      = canAttackGrabbedPlayer;
            attackHitInfo.damageNumAddGroup           = damageNumAddGroup;
            attackHitInfo.dontIncreaseGauge           = dontIncreaseGauge;
            attackHitInfo.attackType                  = attackType;
            attackHitInfo.elementType                 = elementType;
            attackHitInfo.spAttackType                = spAttackType;
            attackHitInfo.toShieldAtk                 = toShieldAtk;
            attackHitInfo.toShieldCriticalRate        = toShieldCriticalRate;
            attackHitInfo.toShieldElementCriticalRate = toShieldElementCriticalRate;
            attackHitInfo.atk.Copy(atk);
            attackHitInfo.badStatus.Copy(badStatus);
            attackHitInfo.toPlayer.Copy(toPlayer);
            attackHitInfo.toEnemy.Copy(toEnemy);
            attackHitInfo.grabInfo.Copy(grabInfo);
            attackHitInfo.restraintInfo.Copy(restraintInfo);
            attackHitInfo.electricShockInfo.Copy(electricShockInfo);
            attackHitInfo.inkSplashInfo.Copy(inkSplashInfo);
            if (buffIDs != null)
            {
                int num = buffIDs.Length;
                attackHitInfo.buffIDs = new uint[buffIDs.Length];
                if (num > 0)
                {
                    buffIDs.CopyTo(attackHitInfo.buffIDs, 0);
                }
            }
        }
    }
    // Use this for initialization
    protected override void Start()
    {
        base.Start();                                                                                                                              // set weapon attributes

        this.parentEnemy = this.transform.parent.gameObject.GetComponent <Enemy>();                                                                // set the parent enemy
        Vector3 vectorToPlayer = (this.target.transform.position - this.parentEnemy.transform.position).normalized * this.parentEnemy.attackRange; // get vector from enemy to player

        this.transform.localPosition = transform.localRotation * vectorToPlayer.normalized * 0.1f;                                                 // spawn the missile relative to the enemy and the player
        float angle = Mathf.Atan2(vectorToPlayer.x, vectorToPlayer.y) * Mathf.Rad2Deg * -1f;                                                       // get the angle toward the player

        this.transform.rotation = Quaternion.Euler(0, 0, angle);                                                                                   // update the missile's rotation
        GetComponent <Rigidbody2D>().velocity = transform.up * projectileSpeed;                                                                    // start the missile's travel
        hitInfo          = new AttackHitInfo(damage, knockbackVelocity, knockbackDuration, parentEnemy.element, parentEnemy.elementalLevel, parentEnemy.gameObject);
        transform.parent = null;
    }
    new public void Hit(AttackHitInfo hitInfo, Vector2 knockbackDirection)
    {
        /*
         * if (knockbackDirection) { // if the knockback indicates that the direction came from in front of the shield
         *
         * }
         */

        base.Hit(hitInfo, knockbackDirection); // make the hit happen

        // make knockback happen even if damage was 0, as long as the enemy isn't currently invulnerable
        if (damage <= 0 && !knockedBack && !recoveringFromHit)
        {
            base.Knockback(knockbackVelocity, knockbackDirection, knockbackDuration);
        }
    }
Beispiel #21
0
 public bool CheckHitAttack(AttackHitInfo info, Collider to_collider, StageObject to_object)
 {
     if (m_attackHitChecker != null && !m_attackHitChecker.CheckHitAttack(info, to_collider, to_object))
     {
         return(false);
     }
     if (info.attackType == AttackHitInfo.ATTACK_TYPE.HEAL_ATTACK && to_object is Enemy)
     {
         Enemy enemy = to_object as Enemy;
         if (enemy.healDamageRate <= 0f)
         {
             return(false);
         }
     }
     return(true);
 }
Beispiel #22
0
	void Awake()
	{
		playerInput = GetComponent<PlayerInput>();

		initialHealthBarScale = healthBar.localScale.x;
		maxHealth = health;
		healthText.text = health.ToString();
		minusText.text = "";

		currentActionParams = new ADParams();

		attackOrDefenseAction = DoNothing;
		hitInfo = new AttackHitInfo(Elements.NONE, 0);

		shields.Add(Elements.FIRE, fireShield);
		shields.Add(Elements.WATER, waterShield);
		shields.Add(Elements.AIR, airShield);
		shields.Add(Elements.EARTH, earthShield);
	}
    public virtual void Hit(AttackHitInfo hitInfo, Vector2 knockbackDirection)
    {
        if (this.recoveryTimeElapsed < this.hitRecoveryTime && invulnerableWhileRecovering)  // if no damage was dealt, or if the actor is invulerable
        {
            return;                                                                          // do nothing
        }
        currentHealth -= hitInfo.damage;                                                     // take damage
        Knockback(hitInfo.knockbackVelocity, knockbackDirection, hitInfo.knockbackDuration); // knock the enemy backward
        this.StartFlashing();                                                                // indicate damage by flashing

        switch (hitInfo.element)
        {
        case Element.Fire:
            if (burning)
            {
                EnqueueFloatingText("CRIT!", Color.red);
                currentHealth -= hitInfo.damage;     // take double damage
            }
            else
            {
                Burn(1, hitInfo.elementalPower);
            }
            break;

        case Element.Ice:
            if (frozen)
            {
                Shatter(hitInfo.elementalPower);
            }
            else
            {
                Freeze(34 * hitInfo.elementalPower);
            }
            break;

        default:
            break;
        }

        UpdateHealthBar();
    }
Beispiel #24
0
    private void _Initialize(StageObject attacker, Transform parent, Vector3 pos, Vector3 rot, float height, int attackLayer, float healAtk, float radius)
    {
        //IL_000d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0055: Unknown result type (might be due to invalid IL or missing references)
        //IL_005a: Expected O, but got Unknown
        //IL_0063: Unknown result type (might be due to invalid IL or missing references)
        //IL_006c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0071: Unknown result type (might be due to invalid IL or missing references)
        //IL_0072: Unknown result type (might be due to invalid IL or missing references)
        //IL_007d: Unknown result type (might be due to invalid IL or missing references)
        //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
        m_player = (attacker as Player);
        this.get_gameObject().set_layer(attackLayer);
        AttackHitInfo attackHitInfo = m_player.FindAttackInfo(isDuplicate: this.isDuplicateAttackInfo, name: GetAttackInfoName(), fix_rate: true) as AttackHitInfo;

        attackHitInfo.atk.normal = healAtk;
        m_attacker   = attacker;
        m_attackInfo = attackHitInfo;
        Transform val = this.get_transform();

        val.set_parent(parent);
        val.set_localEulerAngles(rot);
        val.set_localPosition(val.get_localRotation() * pos);
        val.set_localScale(Vector3.get_one());
        m_capsule.set_direction(2);
        m_capsule.set_radius(radius);
        m_capsule.set_height(height);
        m_capsule.set_enabled(true);
        m_capsule.set_center(new Vector3(0f, 0f, height * 0.5f));
        m_capsule.set_isTrigger(true);
        m_timeCount = 0f;
        if (MonoBehaviourSingleton <AttackColliderManager> .IsValid())
        {
            m_colliderProcessor = MonoBehaviourSingleton <AttackColliderManager> .I.CreateProcessor(m_attackInfo, attacker, m_capsule, this, Player.ATTACK_MODE.NONE, null);

            m_attackHitChecker = attacker.ReferenceAttackHitChecker();
        }
    }
 public void Initialize(InitParamFloatingMine initParam)
 {
     //IL_00be: Unknown result type (might be due to invalid IL or missing references)
     //IL_00c3: Expected O, but got Unknown
     //IL_0106: Unknown result type (might be due to invalid IL or missing references)
     //IL_010d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0113: Unknown result type (might be due to invalid IL or missing references)
     //IL_0118: Unknown result type (might be due to invalid IL or missing references)
     //IL_011d: Unknown result type (might be due to invalid IL or missing references)
     //IL_012f: Unknown result type (might be due to invalid IL or missing references)
     //IL_0135: Unknown result type (might be due to invalid IL or missing references)
     //IL_013a: 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_015c: Unknown result type (might be due to invalid IL or missing references)
     //IL_0161: Expected O, but got Unknown
     //IL_016b: Unknown result type (might be due to invalid IL or missing references)
     //IL_0178: Unknown result type (might be due to invalid IL or missing references)
     //IL_017d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0189: Unknown result type (might be due to invalid IL or missing references)
     //IL_0196: Unknown result type (might be due to invalid IL or missing references)
     //IL_019b: Expected O, but got Unknown
     //IL_01c1: Unknown result type (might be due to invalid IL or missing references)
     //IL_01c6: Unknown result type (might be due to invalid IL or missing references)
     //IL_01fa: Unknown result type (might be due to invalid IL or missing references)
     //IL_01ff: Expected O, but got Unknown
     //IL_021e: Unknown result type (might be due to invalid IL or missing references)
     //IL_0220: Unknown result type (might be due to invalid IL or missing references)
     if (initParam.atkInfo != null)
     {
         m_atkInfo = initParam.atkInfo;
         AttackHitInfo attackHitInfo = m_atkInfo as AttackHitInfo;
         if (attackHitInfo != null)
         {
             attackHitInfo.enableIdentityCheck = false;
         }
         BulletData bulletData = m_atkInfo.bulletData;
         if (!(bulletData == null))
         {
             BulletData.BulletBase data = bulletData.data;
             if (data != null)
             {
                 BulletData.BulletMine dataMine = bulletData.dataMine;
                 if (dataMine != null)
                 {
                     m_attacker          = initParam.attacker;
                     m_landHitEffectName = data.landHiteffectName;
                     m_aliveTimer        = data.appearTime;
                     m_moveSpeed         = data.speed;
                     m_slowDownRate      = dataMine.slowDownRate;
                     m_unbreakableTimer  = dataMine.unbrakableTime;
                     m_mineData          = dataMine;
                     m_isDeleted         = false;
                     m_cachedTransform   = this.get_transform();
                     m_cachedTransform.set_parent((!MonoBehaviourSingleton <StageObjectManager> .IsValid()) ? MonoBehaviourSingleton <EffectManager> .I._transform : MonoBehaviourSingleton <StageObjectManager> .I._transform);
                     Transform launchTrans = initParam.launchTrans;
                     m_cachedTransform.set_position(launchTrans.get_position() + launchTrans.get_rotation() * initParam.offsetPos);
                     m_cachedTransform.set_rotation(launchTrans.get_rotation() * initParam.offsetRot);
                     m_cachedTransform.set_localScale(data.timeStartScale);
                     Transform effect = EffectManager.GetEffect(data.effectName, this.get_transform());
                     effect.set_localPosition(data.dispOffset);
                     effect.set_localRotation(Quaternion.Euler(data.dispRotation));
                     effect.set_localScale(Vector3.get_one());
                     m_effectObj            = effect.get_gameObject();
                     m_effectDeleteAnimator = m_effectObj.GetComponent <Animator>();
                     float   radius    = data.radius;
                     float   height    = 0f;
                     Vector3 hitOffset = data.hitOffset;
                     int     num       = 0;
                     if (dataMine.isIgnoreHitEnemyAttack)
                     {
                         num |= 0xA000;
                     }
                     if (dataMine.isIgnoreHitEnemyMove)
                     {
                         num |= 0x400;
                     }
                     GameObject       val = new GameObject("MineAttackObject");
                     MineAttackObject mineAttackObject = val.AddComponent <MineAttackObject>();
                     mineAttackObject.Initialize(m_attacker, m_cachedTransform, m_atkInfo, hitOffset, Vector3.get_zero(), radius, height, 31);
                     mineAttackObject.SetIgnoreLayerMask(num);
                     m_mineAttackObj = mineAttackObject;
                     RequestMain();
                 }
             }
         }
     }
 }
Beispiel #26
0
    public void Initialize(StageObject attacker, Transform parentTrans, AttackInfo atkInfo, int numLaser)
    {
        //IL_0095: Unknown result type (might be due to invalid IL or missing references)
        //IL_009a: Expected O, but got Unknown
        //IL_00d9: Unknown result type (might be due to invalid IL or missing references)
        //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
        //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
        //IL_0119: Unknown result type (might be due to invalid IL or missing references)
        //IL_011e: Unknown result type (might be due to invalid IL or missing references)
        //IL_0140: Unknown result type (might be due to invalid IL or missing references)
        //IL_0145: Expected O, but got Unknown
        //IL_0156: Unknown result type (might be due to invalid IL or missing references)
        //IL_0164: Unknown result type (might be due to invalid IL or missing references)
        BulletData bulletData = atkInfo.bulletData;

        if (!(bulletData == null))
        {
            BulletData.BulletBase  data      = bulletData.data;
            BulletData.BulletLaser dataLaser = bulletData.dataLaser;
            if (dataLaser != null && data != null)
            {
                m_attacker      = attacker;
                m_aliveTimer    = data.appearTime;
                m_nowAngleSpeed = dataLaser.initAngleSpeed;
                m_laserData     = dataLaser;
                m_parentTrans   = parentTrans;
                int           attackLayer   = (!(attacker is Player)) ? 15 : 14;
                AttackHitInfo attackHitInfo = atkInfo as AttackHitInfo;
                if (attackHitInfo != null)
                {
                    attackHitInfo.enableIdentityCheck = false;
                }
                m_atkInfoName = atkInfo.name;
                Transform val = this.get_transform();
                if (m_laserData.isLinkPositionOnly)
                {
                    val.set_parent((!MonoBehaviourSingleton <StageObjectManager> .IsValid()) ? MonoBehaviourSingleton <EffectManager> .I._transform : MonoBehaviourSingleton <StageObjectManager> .I._transform);
                    val.set_position(parentTrans.get_position());
                }
                else
                {
                    val.set_parent(parentTrans);
                    val.set_localPosition(Vector3.get_zero());
                }
                val.set_localRotation(Quaternion.get_identity());
                float   radius         = data.radius;
                float   capsuleHeight  = dataLaser.capsuleHeight;
                Vector3 offsetPosition = dataLaser.offsetPosition;
                float   num            = 360f / (float)numLaser;
                float   num2           = 0f;
                for (int i = 0; i < numLaser; i++)
                {
                    GameObject        val2 = new GameObject("LaserAttackObject");
                    LaserAttackObject laserAttackObject = val2.AddComponent <LaserAttackObject>();
                    laserAttackObject.Initialize(attacker, val, atkInfo, offsetPosition, new Vector3(0f, num2, 0f), radius, capsuleHeight, attackLayer);
                    laserAttackObject.CreateEffect(data);
                    m_laserAttackList.Add(laserAttackObject);
                    num2 += num;
                }
            }
        }
    }
 public void ClearHitInfo(AttackHitInfo info)
 {
     ClearHitInfo(info.name);
 }
 public virtual bool CheckHitAttack(AttackHitInfo info, Collider to_collider, StageObject to_object)
 {
     return(true);
 }
 public virtual void OnHitAttack(AttackHitInfo info, AttackHitColliderProcessor.HitParam hit_param)
 {
     hit_param.toObject.OnAttackedHit(info, hit_param);
 }
Beispiel #30
0
	public void TakeHit(AttackHitInfo hit)
	{
		if(hit.element == Elements.NONE)
			return;

		bool shieldDestroyed = false;
		float shieldElementals = 1.25f;
		if(currentDefenseType != Elements.NONE)
		{
			shieldElementals = shields[currentDefenseType].TakeDamage(hit.element, out shieldDestroyed);
		}

		float critChance = 1;

		float totalDamage = (hit.attack / defense) * shieldElementals * critChance;
		health-= totalDamage;
		minusText.text = totalDamage.ToString();
		healthText.text = health.ToString();

		UpdateHealthBar();

		if(shieldDestroyed)
		{
			currentDefenseType = Elements.NONE;
		}

		if(health <= 0)
		{
			health = 0;
			Game.screenManager.Lost(orientation);
			return;
		}

		Game.soundManager.PlayPlayerHit();

	}
Beispiel #31
0
 //function called by another gameobject use a SendMessage
 //means someone doing an attack hit you
 void OnAttackHit( AttackHitInfo atkHit )
 {
     lastAttackHit = atkHit;
     Damage();
 }
Beispiel #32
0
 //function called by another gameobject use a SendMessage
 //means someone doing an attack hit you
 void OnAttackHit( AttackHitInfo atkHit )
 {
     Damage();
 }
Beispiel #33
0
 public void SetHitInfo(AttackHitInfo hitInfo)
 {
     this.hitInfo = hitInfo;
     SetElement(hitInfo.element);
 }
Beispiel #34
0
    public virtual void Shot(StageObject master, AttackInfo atkInfo, BulletData bulletData, Vector3 pos, Quaternion rot, string exEffectName = null, bool reference_attack = true, AtkAttribute exAtk = null, Player.ATTACK_MODE attackMode = Player.ATTACK_MODE.NONE, DamageDistanceTable.DamageDistanceData damageDistanceData = null, SkillInfo.SkillParam exSkillParam = null)
    {
        //IL_0008: Unknown result type (might be due to invalid IL or missing references)
        //IL_0080: Unknown result type (might be due to invalid IL or missing references)
        //IL_0096: Unknown result type (might be due to invalid IL or missing references)
        //IL_009b: Unknown result type (might be due to invalid IL or missing references)
        //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
        //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
        //IL_01ed: Unknown result type (might be due to invalid IL or missing references)
        //IL_0202: Unknown result type (might be due to invalid IL or missing references)
        //IL_02d4: Unknown result type (might be due to invalid IL or missing references)
        //IL_02d9: Unknown result type (might be due to invalid IL or missing references)
        //IL_02f6: Unknown result type (might be due to invalid IL or missing references)
        //IL_02fb: Unknown result type (might be due to invalid IL or missing references)
        //IL_031d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0322: Unknown result type (might be due to invalid IL or missing references)
        //IL_0344: Unknown result type (might be due to invalid IL or missing references)
        //IL_0349: Unknown result type (might be due to invalid IL or missing references)
        //IL_0352: Unknown result type (might be due to invalid IL or missing references)
        //IL_0357: Unknown result type (might be due to invalid IL or missing references)
        //IL_0359: Unknown result type (might be due to invalid IL or missing references)
        //IL_036b: Unknown result type (might be due to invalid IL or missing references)
        Player player = master as Player;

        this.get_gameObject().SetActive(true);
        stageObject  = master;
        m_exAtk      = exAtk;
        m_attackMode = attackMode;
        string text = bulletData.data.GetEffectName(player);

        if (!string.IsNullOrEmpty(exEffectName))
        {
            text = exEffectName;
        }
        if (!string.IsNullOrEmpty(text))
        {
            bulletEffect = EffectManager.GetEffect(text, _transform);
            if (bulletEffect != null)
            {
                bulletEffect.set_localPosition(bulletData.data.dispOffset);
                bulletEffect.set_localRotation(Quaternion.Euler(bulletData.data.dispRotation));
                bulletEffect.set_localScale(Vector3.get_one());
            }
        }
        AttackHitInfo attackHitInfo = atkInfo as AttackHitInfo;

        if (exAtk != null)
        {
            masterAtk = exAtk;
        }
        else if (attackHitInfo != null)
        {
            if (player != null && HasEndBulletSkillIndex)
            {
                int skillIndex = player.skillInfo.skillIndex;
                player.skillInfo.skillIndex = m_endBulletSkillIndex;
                master.GetAtk(attackHitInfo, ref masterAtk);
                player.skillInfo.skillIndex = skillIndex;
            }
            else
            {
                master.GetAtk(attackHitInfo, ref masterAtk);
            }
        }
        masterSkill = null;
        if (player != null)
        {
            if (exSkillParam != null)
            {
                masterSkill = exSkillParam;
            }
            else
            {
                masterSkill = player.skillInfo.actSkillParam;
                if (player.TrackingTargetBullet != null && player.TrackingTargetBullet.IsReplaceSkill && atkInfo.isSkillReference)
                {
                    masterSkill = player.TrackingTargetBullet.SkillParamForBullet;
                }
                if (HasEndBulletSkillIndex)
                {
                    masterSkill = player.GetSkillParam(m_endBulletSkillIndex);
                }
            }
        }
        if (bulletData.data.isEmitGround)
        {
            pos.y = 0f;
        }
        SetBulletData(bulletData, masterSkill, pos, rot);
        if (bulletData.type == BulletData.BULLET_TYPE.OBSTACLE)
        {
            AttackObstacle attackObstacle = this.get_gameObject().AddComponent <AttackObstacle>();
            attackObstacle.Initialize(this as AnimEventShot, bulletData.dataObstacle.colliderStartTime);
        }
        else if (bulletData.type != BulletData.BULLET_TYPE.HEALING_HOMING)
        {
            int layer = (!(master is Player)) ? 15 : 14;
            Utility.SetLayerWithChildren(_transform, layer);
        }
        timeCount = 0f;
        if (MonoBehaviourSingleton <AttackColliderManager> .IsValid())
        {
            colliderProcessor = MonoBehaviourSingleton <AttackColliderManager> .I.CreateProcessor(atkInfo, stageObject, _collider, this, attackMode, damageDistanceData);

            if (reference_attack)
            {
                attackHitChecker = stageObject.ReferenceAttackHitChecker();
            }
            if (bulletData.type == BulletData.BULLET_TYPE.SNATCH || bulletData.type == BulletData.BULLET_TYPE.PAIR_SWORDS_LASER)
            {
                colliderProcessor.ValidTriggerStay();
            }
        }
        Vector3 val = Vector3.get_zero();

        if (_collider is BoxCollider)
        {
            val = (_collider as BoxCollider).get_center();
        }
        else if (_collider is SphereCollider)
        {
            val = (_collider as SphereCollider).get_center();
        }
        else if (_collider is CapsuleCollider)
        {
            val = (_collider as CapsuleCollider).get_center();
        }
        startColliderPos = _transform.get_position() + val;
        isDestroyed      = false;
        prevPosition     = pos;
        if (controller != null)
        {
            controller.OnShot();
        }
    }