コード例 #1
0
    void HighlightStaffArea(Fighter f, Cell[] range)
    {
        Weapon.AttackData data = f.Unit.inventory.GetStaffData(f);
        if (data == null)
        {
            //Debug.LogWarning("Staff not found");
            return;
        }

        List <Cell> _last = new List <Cell>();

        foreach (Cell c in AttackArea)
        {
            _last.Add(c);
        }

        StaffArea = Map.GetExtendedArea(range, data.range, data.closedSet, data.closedSetMin);

        if (highlight == null)
        {
            highlight = new List <Cell>();
        }

        foreach (Cell c in StaffArea)
        {
            if (_last.Contains(c))
            {
                continue;
            }

            Highlight(c, "green");
        }
    }
コード例 #2
0
ファイル: UnitData.cs プロジェクト: SpyClops/Test
 public void Damage(Weapon.AttackData attackData)
 {
     m_HitCoolDown      = 5f;
     regenerationsBlock = false;
     Stats.Damage(attackData);
     OnDamage?.Invoke();
 }
コード例 #3
0
ファイル: ApplyBurnWeaponEffect.cs プロジェクト: chao140/AVD
    public override void OnAttack(CharacterData target, CharacterData user, ref Weapon.AttackData attackData)
    {
        if (Random.value < (PercentageChance / 100.0f))
        {
            ElementalEffect effect = new ElementalEffect(Time, StatSystem.DamageType.Fire, Damage, 1.0f);

            target.Stats.AddElementalEffect(effect);
        }
    }
コード例 #4
0
ファイル: BaseAI.cs プロジェクト: cyv-cg/FE
    void GetAtkData()
    {
        AtkData = Fighter.Unit.inventory.GetAttackData(Fighter);

        if (AtkData != null)
        {
            foreach (Cell c in Map.GetExtendedArea(MoveArea.ToArray(), AtkData))
            {
                AttackArea.Add(c);
            }
        }
    }
コード例 #5
0
    void HighlightAttackArea(Fighter f, Cell[] range)
    {
        Weapon.AttackData data = f.Unit.inventory.GetAttackData(f);
        if (data == null)
        {
            //Debug.LogWarning("Weapon not found");
            return;
        }

        List <Cell> _last = new List <Cell>();

        foreach (Cell c in range)
        {
            _last.Add(c);
        }

        AttackArea = Map.GetExtendedArea(range, data.range, data.closedSet, data.closedSetMin);

        if (highlight == null)
        {
            highlight = new List <Cell>();
        }

        foreach (Cell c in AttackArea)
        {
            if (highlight.Contains(c) || _last.Contains(c))
            {
                continue;
            }

            Fighter u = c.unitInTile;

            if (u == null)
            {
                Highlight(c, "red");
                continue;
            }

            if (f.Unit.alignment == u.Unit.alignment)
            {
                Highlight(c, "blue");
            }
            else
            {
                Highlight(c, "red");
            }
        }
    }
コード例 #6
0
    public void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Enemy"))
        {
            CharacterData target = other.gameObject.GetComponent <SimpleEnemyController>().GetCharacterData();
            if (target == null)
            {
                return;
            }
            CharacterData playerData = CharacterControl.Instance.Data;

            Weapon.AttackData attackData = new Weapon.AttackData(target, playerData);
            attackData.AddDamage(StatSystem.DamageType.Fire, damage);
            target.Damage(attackData);
        }
    }
コード例 #7
0
    private IEnumerator OnSelectedChange()
    {
        ClearDrawnPath();
        ClearHighlightedArea();

        yield return(StartCoroutine(Fighter.ApplyPath(QPath.FindPath(Fighter, startCell, Selected, Cell.EstimateDistance), GameSettings.DoMoveAnimation)));

        AttackArea = new Cell[0];
        StaffArea  = new Cell[0];

        if (Fighter.Unit.inventory.GetWeapons(Fighter, true).Length > 0)
        {
            Weapon.AttackData atkData = Fighter.Unit.inventory.GetAttackData(Fighter);
            if (atkData != null)
            {
                AttackArea = Map.GetExtendedArea(new Cell[] { Map.UnitTile(Fighter) }, atkData.range, atkData.closedSet, atkData.closedSetMin);
            }
        }

        if (Fighter.Unit.inventory.GetStaves(Fighter, true).Length > 0)
        {
            Weapon.AttackData stfData = Fighter.Unit.inventory.GetStaffData(Fighter);
            if (stfData != null)
            {
                StaffArea = Map.GetExtendedArea(new Cell[] { Map.UnitTile(Fighter) }, stfData.range, stfData.closedSet, stfData.closedSetMin);
            }
        }

        CurrentRange = new List <Cell>
        {
            Map.GetCellData(Fighter.Position())
        };
        DoHighlights(Fighter, CurrentRange.ToArray(), false);

        ActionMenu.Open(Fighter);
        ActionMenu.ActionDone = false;
    }
コード例 #8
0
ファイル: VampiricWeaponEffect.cs プロジェクト: chao140/AVD
    public override void OnPostAttack(CharacterData target, CharacterData user, Weapon.AttackData data)
    {
        int amount = Mathf.FloorToInt(data.GetDamage(StatSystem.DamageType.Physical) * (PercentageHealthStolen / 100.0f));

        user.Stats.ChangeHealth(amount);
    }
コード例 #9
0
        public void Damage(Weapon.AttackData attackData)
        {
            int totalDamage = attackData.GetFullDamage();

            ChangeHealth(-totalDamage);
        }
コード例 #10
0
ファイル: Map.cs プロジェクト: cyv-cg/FE
 public static Cell[] GetExtendedArea(Cell[] moveArea, Weapon.AttackData data)
 {
     return(GetExtendedArea(moveArea, data.range, data.closedSet, data.closedSetMin));
 }