コード例 #1
0
    private List <CharacterBhv> IsOpponentInZone(int x, int y)
    {
        var character = _currentCharacterBhv.Character;

        if (character.Weapons[_currentWeaponId].RangeZones == null)
        {
            return(null);
        }
        List <CharacterBhv> tmpTouchedOpponents = new List <CharacterBhv>();

        foreach (var tmpDirection in character.Weapons[_currentWeaponId].RangeZones)
        {
            var tmpPos = Helper.DetermineRangePosFromRangeDirection(x - _currentCharacterBhv.X, y - _currentCharacterBhv.Y, tmpDirection);
            var tmpX   = tmpPos.X + x;
            var tmpY   = tmpPos.Y + y;
            if (!Helper.IsPosValid(tmpX, tmpY))
            {
                continue;
            }
            var          cell       = Cells[tmpX, tmpY].GetComponent <CellBhv>();
            CharacterBhv tmpTouched = null;
            if (cell.Type == CellType.On && (tmpTouched = IsOpponentOnCell(tmpX, tmpY)) != null)
            {
                tmpTouchedOpponents.Add(tmpTouched);
                continue;
            }
        }
        if (tmpTouchedOpponents.Count != 0)
        {
            return(tmpTouchedOpponents);
        }
        return(null);
    }
コード例 #2
0
    public bool IsOpponentInSkillRange(CharacterBhv characterBhv, int skillId, List <CharacterBhv> opponentBhvs)
    {
        _currentCharacterBhv = characterBhv;
        _currentOpponentBhvs = opponentBhvs;
        var character = characterBhv.Character;

        for (int i = 0; i < character.Skills[skillId].RangePositions?.Count; i += 2)
        {
            var x = character.Skills[skillId].RangePositions[i] + characterBhv.X;
            var y = character.Skills[skillId].RangePositions[i + 1] + characterBhv.Y;
            if (!Helper.IsPosValid(x, y))
            {
                continue;
            }
            var cell = Cells[x, y].GetComponent <CellBhv>();
            if (cell.Type == CellType.On)
            {
                if (IsAnythingBetween(characterBhv.X, characterBhv.Y, x, y))
                {
                    continue;
                }
                else if (IsOpponentOnCell(x, y) != null)
                {
                    return(true);
                }
            }
        }
        return(false);
    }
コード例 #3
0
    public RangePos IsOpponentInWeaponRangeAndZone(CharacterBhv characterBhv, int weaponId, List <CharacterBhv> opponentBhvs)
    {
        _currentCharacterBhv = characterBhv;
        _currentOpponentBhvs = opponentBhvs;
        _currentWeaponId     = weaponId;
        var character = characterBhv.Character;

        for (int i = 0; i < character.Weapons[weaponId].RangePositions.Count; i += 2)
        {
            var x = character.Weapons[weaponId].RangePositions[i] + characterBhv.X;
            var y = character.Weapons[weaponId].RangePositions[i + 1] + characterBhv.Y;
            if (!Helper.IsPosValid(x, y))
            {
                continue;
            }
            var cell = Cells[x, y].GetComponent <CellBhv>();
            if (cell.Type == CellType.On)
            {
                if (IsAnythingBetween(characterBhv.X, characterBhv.Y, x, y))
                {
                    continue;
                }
                else if (IsOpponentOnCell(x, y) != null || IsOpponentInZone(x, y) != null)
                {
                    return(new RangePos(x, y));
                }
            }
        }
        return(null);
    }
コード例 #4
0
    public void ShowWeaponRange(CharacterBhv characterBhv, int weaponId, List <CharacterBhv> opponentBhvs)
    {
        ResetAllCellsDisplay();
        _currentCharacterBhv = characterBhv;
        _currentOpponentBhvs = opponentBhvs;
        _currentWeaponId     = weaponId;
        var character = characterBhv.Character;

        for (int i = 0; i < character.Weapons[weaponId].RangePositions.Count; i += 2)
        {
            var x = character.Weapons[weaponId].RangePositions[i] + characterBhv.X;
            var y = character.Weapons[weaponId].RangePositions[i + 1] + characterBhv.Y;
            if (!Helper.IsPosValid(x, y))
            {
                continue;
            }
            var cell = Cells[x, y].GetComponent <CellBhv>();
            if (cell.Type == CellType.On && cell.State == CellState.None)
            {
                if (IsAnythingBetween(characterBhv.X, characterBhv.Y, x, y))
                {
                    cell.ShowWeaponOutOfRange();
                }
                else
                {
                    cell.ShowWeaponRange();
                }
            }
        }
    }
コード例 #5
0
 public void SetPrivates()
 {
     _characterBhv  = GetComponent <CharacterBhv>();
     _opponentBhv   = _characterBhv.OpponentBhvs[0];
     _gridBhv       = GameObject.Find(Constants.GoSceneBhvName).GetComponent <GridBhv>();
     _fightSceneBhv = GameObject.Find(Constants.GoSceneBhvName).GetComponent <FightSceneBhv>();
 }
コード例 #6
0
ファイル: SkillAvarice.cs プロジェクト: MaximeRadomski/Rogue
    public override void OnEndAttack(int damages, CharacterBhv opponentBhv)
    {
        CharacterBhv.Instantiator.NewEffect(InventoryItemType.Skill, CharacterBhv.transform.position, null, EffectId, Constants.GridMax - CharacterBhv.Y);
        float goldToSteal = CharacterBhv.Character.Gold * Helper.MultiplierFromPercent(0, _percentToSteal);

        CharacterBhv.Character.GainGold((int)goldToSteal);
    }
コード例 #7
0
ファイル: Skill.cs プロジェクト: MaximeRadomski/Rogue
 public virtual void Init(CharacterBhv characterBhv, List <CharacterBhv> opponentBhvs, GridBhv gridBhv, int id)
 {
     CharacterBhv = characterBhv;
     OpponentBhvs = opponentBhvs;
     GridBhv      = gridBhv;
     Id           = id;
 }
コード例 #8
0
ファイル: FightSceneBhv.cs プロジェクト: MaximeRadomski/Rogue
    private void AddToLoot(CharacterBhv opponentBhv)
    {
        if (_loot == null)
        {
            _loot = new List <InventoryItem>();
        }
        var drop = Random.Range(0, 100);

        if (drop > PlayerBhv.Character.LootPercent)
        {
            return;
        }
        var           type = Random.Range(0, Helper.EnumCount <InventoryItemType>());
        InventoryItem item = null;

        if (type == InventoryItemType.Weapon.GetHashCode())
        {
            item = opponentBhv.Character.Weapons[Random.Range(0, 2)];
        }
        else if (type == InventoryItemType.Skill.GetHashCode())
        {
            item = opponentBhv.Character.Skills[Random.Range(0, 2)];
        }
        else if (type == InventoryItemType.Item.GetHashCode())
        {
            item = ItemsData.GetRandomItem();
        }
        if (item == null)
        {
            return;
        }
        item.LootHistory = "Looted from " + opponentBhv.Character.Name + ",\na level " + opponentBhv.Character.Level + " " + opponentBhv.Character.Race;
        _loot.Add(item);
    }
コード例 #9
0
ファイル: FightSceneBhv.cs プロジェクト: MaximeRadomski/Rogue
 private void RemoveOpponentFromExistence(CharacterBhv opponentBhv)
 {
     for (int i = 0; i < _orderList.Count; ++i)
     {
         if (_orderList[i].Id == opponentBhv.OrderId)
         {
             if (i < _currentOrderId)
             {
                 --_currentOrderId;
             }
             _orderList.RemoveAt(i);
             break;
         }
     }
     for (int i = 0; i < PlayerBhv.OpponentBhvs.Count; ++i)
     {
         if (PlayerBhv.OpponentBhvs[i].OrderId == opponentBhv.OrderId)
         {
             PlayerBhv.OpponentBhvs.RemoveAt(i);
             break;
         }
     }
     for (int i = 0; i < OpponentBhvs.Count; ++i)
     {
         if (OpponentBhvs[i].OrderId == opponentBhv.OrderId)
         {
             OpponentBhvs.RemoveAt(i);
             break;
         }
     }
 }
コード例 #10
0
    public void ShowSkillRange(RangeType rangeType, CharacterBhv characterBhv, int skillId, List <CharacterBhv> opponentBhvs, bool hasToBeEmpty = false)
    {
        ResetAllCellsDisplay();
        ResetAllCellsVisited();
        ResetAllCellsSkillVisited();
        _currentCharacterBhv = characterBhv;
        _currentOpponentBhvs = opponentBhvs;
        _currentSkillId      = skillId;
        var character = characterBhv.Character;

        if (rangeType != RangeType.FullRange)
        {
            if (character.Skills[skillId].RangePositions == null || character.Skills[skillId].RangePositions.Count == 0)
            {
                return;
            }
            for (int i = 0; i < character.Skills[skillId].RangePositions.Count; i += 2)
            {
                var x = character.Skills[skillId].RangePositions[i] + characterBhv.X;
                var y = character.Skills[skillId].RangePositions[i + 1] + characterBhv.Y;
                ShowSkillRangeOnPosition(x, y, hasToBeEmpty, rangeType, characterBhv);
            }
        }
        else
        {
            for (int x = 0; x < Constants.GridMax; ++x)
            {
                for (int y = 0; y < Constants.GridMax; ++y)
                {
                    ShowSkillRangeOnPosition(x, y, hasToBeEmpty, rangeType, characterBhv);
                }
            }
        }
    }
コード例 #11
0
ファイル: SkillClarity.cs プロジェクト: MaximeRadomski/Rogue
 public void Debuff(CharacterBhv debuffedOpponentBhv)
 {
     if (debuffedOpponentBhv == null)
     {
         return;
     }
     debuffedOpponentBhv.ClearAllSkillEffects(isDebuff: true);
 }
コード例 #12
0
 public virtual void OnPlayerDeath(CharacterBhv playerBhv)
 {
     playerBhv.Character.IsDead = true;
     StartCoroutine(Helper.ExecuteAfterDelay(1.0f, () =>
     {
         Defeat(playerBhv.Character);
         return(true);
     }));
 }
コード例 #13
0
ファイル: SkillShield.cs プロジェクト: MaximeRadomski/Rogue
 public override void Activate(int x, int y)
 {
     base.Activate(x, y);
     CharacterBhv.StartCoroutine(Helper.ExecuteAfterDelay(PlayerPrefsHelper.GetSpeed(), () =>
     {
         AfterActivation();
         return(true);
     }));
 }
コード例 #14
0
ファイル: SkillJump.cs プロジェクト: MaximeRadomski/Rogue
 public override void Activate(int x, int y)
 {
     base.Activate(x, y);
     CharacterBhv.StartCoroutine(Helper.ExecuteAfterDelay(PlayerPrefsHelper.GetSpeed(), () =>
     {
         CharacterBhv.Instantiator.NewEffect(InventoryItemType.Skill, GridBhv.Cells[x, y].transform.position, null, EffectId, Constants.GridMax - y);
         CharacterBhv.MoveToPosition(x, y, false);
         return(true);
     }));
 }
コード例 #15
0
    public void Smite(CharacterBhv smitedOpponentBhv)
    {
        if (smitedOpponentBhv == null)
        {
            return;
        }
        var floatAmount = 100.0f * CharacterBhv.Character.GetDamageMultiplier();

        smitedOpponentBhv.TakeDamages(new Damage((int)floatAmount));
    }
コード例 #16
0
ファイル: SkillShield.cs プロジェクト: MaximeRadomski/Rogue
 public override int OnTakeDamage(int damages)
 {
     if (IsApplyingEffect())
     {
         EffectDuration = 0;
         CharacterBhv.Instantiator.NewEffect(InventoryItemType.Skill, CharacterBhv.transform.position, null, EffectId, Constants.GridMax - CharacterBhv.Y);
         CharacterBhv.LoseSkillEffect(Effect);
         return(0);
     }
     return(damages);
 }
コード例 #17
0
ファイル: SkillHeal.cs プロジェクト: MaximeRadomski/Rogue
 public override void Activate(int x, int y)
 {
     base.Activate(x, y);
     CharacterBhv.StartCoroutine(Helper.ExecuteAfterDelay(PlayerPrefsHelper.GetSpeed(), () =>
     {
         CharacterBhv.Instantiator.NewEffect(InventoryItemType.Skill, CharacterBhv.transform.position, null, EffectId, Constants.GridMax - CharacterBhv.Y);
         _floatHealAmount = 50.0f * Helper.MultiplierFromPercent(1, 10 * (CharacterBhv.Character.Level - 1));
         CharacterBhv.GainHp((int)_floatHealAmount);
         AfterActivation();
         return(true);
     }));
 }
コード例 #18
0
 public override void OnStartTurn()
 {
     CharacterBhv.Instantiator.PopIcon(Helper.GetSpriteFromSpriteSheet("Sprites/IconsSkill_" + IconId), CharacterBhv.transform.position);
     CharacterBhv.StartCoroutine(Helper.ExecuteAfterDelay(PlayerPrefsHelper.GetSpeed(), () =>
     {
         CharacterBhv.Instantiator.NewEffect(InventoryItemType.Skill, CharacterBhv.transform.position, null, EffectId, Constants.GridMax - CharacterBhv.Y);
         float hpToRestore = (CharacterBhv.Character.HpMax * 0.05f);
         //hpToRestore *= Helper.MultiplierFromPercent(1.0f, Random.Range(0, 51));
         CharacterBhv.GainHp((int)hpToRestore);
         return(true);
     }));
 }
コード例 #19
0
ファイル: SkillDash.cs プロジェクト: MaximeRadomski/Rogue
 public override void Activate(int x, int y)
 {
     base.Activate(x, y);
     _currentTargetX = x;
     _currentTargetY = y;
     //CharacterBhv.GainSkillEffect(SkillEffect.Immuned);
     CharacterBhv.StartCoroutine(Helper.ExecuteAfterDelay(PlayerPrefsHelper.GetSpeed(), () =>
     {
         CharacterBhv.LosePm(CharacterBhv.Character.PmMax);
         AfterActivation();
         return(true);
     }));
 }
コード例 #20
0
 public override void Activate(int x, int y)
 {
     base.Activate(x, y);
     CharacterBhv.StartCoroutine(Helper.ExecuteAfterDelay(PlayerPrefsHelper.GetSpeed(), () =>
     {
         var result = Grap(GridBhv.IsOpponentOnCell(x, y));
         if (result == false)
         {
             AfterGrap();
         }
         return(true);
     }));
 }
コード例 #21
0
    private void SpreadPmStart(int x, int y, int nbPm, CharacterBhv characterBhv, List <CharacterBhv> opponentBhvs)
    {
        var spentPm = 1;

        if (IsAdjacentOpponent(x, y, opponentBhvs))
        {
            --nbPm;
            ++spentPm;
        }
        SpreadPm(x, y + 1, nbPm, spentPm, characterBhv, opponentBhvs);
        SpreadPm(x + 1, y, nbPm, spentPm, characterBhv, opponentBhvs);
        SpreadPm(x, y - 1, nbPm, spentPm, characterBhv, opponentBhvs);
        SpreadPm(x - 1, y, nbPm, spentPm, characterBhv, opponentBhvs);
    }
コード例 #22
0
ファイル: SkillDash.cs プロジェクト: MaximeRadomski/Rogue
 public override int OnTakeDamage(int damages)
 {
     if (IsApplyingEffect())
     {
         if (Helper.IsPosValid(_currentTargetX, _currentTargetX) && !GridBhv.IsOpponentOnCell(_currentTargetX, _currentTargetY, true, true))
         {
             CharacterBhv.MoveToPosition(_currentTargetX, _currentTargetY, false);
             CharacterBhv.Instantiator.NewEffect(InventoryItemType.Skill, GridBhv.Cells[_currentTargetX, _currentTargetY].transform.position, null, EffectId, Constants.GridMax - _currentTargetY);
         }
         EffectDuration = 0;
         CharacterBhv.LoseSkillEffect(Effect);
         return(0);
     }
     return(damages);
 }
コード例 #23
0
    public void ShowPm(CharacterBhv characterBhv, List <CharacterBhv> opponentBhvs, bool unlimitedPm = false)
    {
        ResetAllCellsVisited();
        ResetAllCellsDisplay();
        _currentCharacterBhv = characterBhv;
        _currentOpponentBhvs = opponentBhvs;
        var nbPm = unlimitedPm ? Constants.UnlimitedPm : characterBhv.GetComponent <CharacterBhv>().Pm;
        int x    = characterBhv.GetComponent <CharacterBhv>().X;
        int y    = characterBhv.GetComponent <CharacterBhv>().Y;

        if (nbPm <= 0)
        {
            return;
        }
        SpreadPmStart(x, y, nbPm, characterBhv, opponentBhvs);
    }
コード例 #24
0
ファイル: FightSceneBhv.cs プロジェクト: MaximeRadomski/Rogue
 public void OnOpponentDeath(CharacterBhv opponentBhv)
 {
     opponentBhv.SkinContainer.OnDeath();
     Instantiator.PopIcon(Helper.GetSpriteFromSpriteSheet("Sprites/IconsStatus_0"), opponentBhv.transform.position);
     StartCoroutine(Helper.ExecuteAfterDelay(1.0f, () =>
     {
         PlayerBhv.Character.GainGold(opponentBhv.Character.Gold);
         PlayerBhv.Character.GainXp(Helper.XpWorthForLevel(opponentBhv.Character.Level));
         RemoveOpponentFromExistence(opponentBhv);
         AddToLoot(opponentBhv);
         Destroy(opponentBhv.gameObject);
         if (_orderList.Count == 1)
         {
             Invoke(nameof(EndFightVictory), 1.0f);
         }
         return(true);
     }));
 }
コード例 #25
0
    public bool Grap(CharacterBhv grabbedOpponentBhv)
    {
        _grabbedOpponentBhv = grabbedOpponentBhv;
        if (_grabbedOpponentBhv == null)
        {
            return(false);
        }
        _grabbedOpponentBhv.AfterMouvementDelegate = AfterGrap;
        int x = CharacterBhv.X - _grabbedOpponentBhv.X;
        int y = CharacterBhv.Y - _grabbedOpponentBhv.Y;

        if (x != 0)
        {
            x = x < 0 ? ++x : --x;
        }
        if (y != 0)
        {
            y = y < 0 ? ++y : --y;
        }
        while (x != 0)
        {
            if (GridBhv.Cells[_grabbedOpponentBhv.X + x, _grabbedOpponentBhv.Y + y].GetComponent <CellBhv>().Type == CellType.On)
            {
                _grabbedOpponentBhv.MoveToPosition(_grabbedOpponentBhv.X + x, _grabbedOpponentBhv.Y + y, false);
                break;
            }
            x = x < 0 ? ++x : --x;
        }
        while (y != 0)
        {
            if (GridBhv.Cells[_grabbedOpponentBhv.X + x, _grabbedOpponentBhv.Y + y].GetComponent <CellBhv>().Type == CellType.On)
            {
                _grabbedOpponentBhv.MoveToPosition(_grabbedOpponentBhv.X + x, _grabbedOpponentBhv.Y + y, false);
                break;
            }
            y = y < 0 ? ++y : --y;
        }
        CharacterBhv.Instantiator.NewEffect(InventoryItemType.Skill, GridBhv.Cells[_grabbedOpponentBhv.X + x, _grabbedOpponentBhv.Y + y].transform.position, null, EffectId, Constants.GridMax - (_grabbedOpponentBhv.Y + y));
        return(true);
    }
コード例 #26
0
    private void SpreadPm(int x, int y, int nbPm, int spentPm, CharacterBhv characterBhv, List <CharacterBhv> opponentBhvs)
    {
        if (!Helper.IsPosValid(x, y) || (opponentBhvs != null && IsOpponentOnCell(x, y, true)) || nbPm <= 0)
        {
            return;
        }
        var cell = Cells[x, y];

        if (cell == null || (x == characterBhv.X && y == characterBhv.Y))
        {
            return;
        }
        if (cell.GetComponent <CellBhv>().Type == CellType.On &&
            (spentPm < cell.GetComponent <CellBhv>().Visited || cell.GetComponent <CellBhv>().Visited == -1) &&
            (opponentBhvs == null || !IsOpponentOnCell(x, y, true)))
        {
            //if (characterBhv.IsPlayer)
            cell.GetComponent <CellBhv>().ShowPm();
            cell.GetComponent <CellBhv>().Visited = spentPm;
            //DEBUG//
            //cell.transform.GetChild(0).GetComponent<UnityEngine.UI.Text>().text = cell.GetComponent<CellBhv>().Visited.ToString();
            if (--nbPm > 0)
            {
                if (IsAdjacentOpponent(x, y, opponentBhvs))
                {
                    --nbPm;
                    ++spentPm;
                    //cell.GetComponent<CellBhv>().Visited = spentPm;
                }
                if (nbPm > 0)
                {
                    SpreadPm(x, y + 1, nbPm, spentPm + 1, characterBhv, opponentBhvs);
                    SpreadPm(x + 1, y, nbPm, spentPm + 1, characterBhv, opponentBhvs);
                    SpreadPm(x, y - 1, nbPm, spentPm + 1, characterBhv, opponentBhvs);
                    SpreadPm(x - 1, y, nbPm, spentPm + 1, characterBhv, opponentBhvs);
                }
            }
        }
    }
コード例 #27
0
ファイル: SkillRoots.cs プロジェクト: MaximeRadomski/Rogue
    public override void OnEndAttack(int damages, CharacterBhv opponentBhv)
    {
        int tmp = Random.Range(0, 100);
        int pmToRemove;

        if (tmp < 5)
        {
            pmToRemove = 0;
        }
        else if (tmp < 50)
        {
            pmToRemove = 1;
        }
        else if (tmp < 95)
        {
            pmToRemove = 2;
        }
        else
        {
            pmToRemove = 3;
        }
        opponentBhv?.LosePm(pmToRemove);
    }
コード例 #28
0
ファイル: FightSceneBhv.cs プロジェクト: MaximeRadomski/Rogue
    private int CalculateInitiative(CharacterBhv characterBhv, int orderId = -1)
    {
        int initiative = 0;

        initiative += (characterBhv.Character.Level - 1) * RacesData.InitiativeLevel;
        if (characterBhv.Character.Weapons != null)
        {
            if (characterBhv.Character.Weapons.Count > 0)
            {
                initiative += characterBhv.Character.Weapons[0].Rarity.GetHashCode() * RacesData.InitiativeWeapon;
            }
            if (characterBhv.Character.Weapons.Count > 1)
            {
                initiative += characterBhv.Character.Weapons[1].Rarity.GetHashCode() * RacesData.InitiativeWeapon;
            }
        }
        if (characterBhv.Character.Skills != null)
        {
            if (characterBhv.Character.Skills.Count > 0)
            {
                initiative += characterBhv.Character.Skills[0].Rarity.GetHashCode() * RacesData.InitiativeSkill;
            }
            if (characterBhv.Character.Skills.Count > 1)
            {
                initiative += characterBhv.Character.Skills[1].Rarity.GetHashCode() * RacesData.InitiativeSkill;
            }
        }
        initiative += characterBhv.Character.Hp / characterBhv.Character.HpMax * 100;
        initiative += _map.Type == characterBhv.Character.StrongIn ? RacesData.InitiativeStrongIn : 0;
        if (orderId != -1)
        {
            characterBhv.Initiative = initiative;
            characterBhv.OrderId    = orderId;
            _orderList.Add(new CharOrder(orderId, initiative));
        }
        return(initiative);
    }
コード例 #29
0
    public bool Push(CharacterBhv pushedOpponentBhv)
    {
        _pushedOpponentBhv = pushedOpponentBhv;
        if (_pushedOpponentBhv == null)
        {
            return(false);
        }
        int x = _pushedOpponentBhv.X - CharacterBhv.X;
        int y = _pushedOpponentBhv.Y - CharacterBhv.Y;

        if (!Helper.IsPosValid(_pushedOpponentBhv.X + x, _pushedOpponentBhv.Y + y) ||
            GridBhv.Cells[_pushedOpponentBhv.X + x, _pushedOpponentBhv.Y + y].GetComponent <CellBhv>().Type != CellType.On ||
            GridBhv.IsOpponentOnCell(_pushedOpponentBhv.X + x, _pushedOpponentBhv.Y + y, true))
        {
            if ((Helper.IsPosValid(_pushedOpponentBhv.X + x, _pushedOpponentBhv.Y + y) &&
                 GridBhv.Cells[_pushedOpponentBhv.X + x, _pushedOpponentBhv.Y + y].GetComponent <CellBhv>().Type == CellType.Off) ||
                GridBhv.IsOpponentOnCell(_pushedOpponentBhv.X + x, _pushedOpponentBhv.Y + y, true))
            {
                var floatAmount = 30.0f * CharacterBhv.Character.GetDamageMultiplier();
                //pushedOpponentBhv.TakeDamages(new Damage((int)floatAmount));
                var damage = new Damage((int)floatAmount);
                CharacterBhv.Instantiator.PopText("-" + pushedOpponentBhv.Character.TakeDamages(damage.Amount).ToString(), pushedOpponentBhv.transform.position, damage.Critical ? TextType.HpCritical : TextType.Hp);
                pushedOpponentBhv.SkinContainer.OnHit();
            }
            else if (!Helper.IsPosValid(_pushedOpponentBhv.X + x, _pushedOpponentBhv.Y + y) ||
                     GridBhv.Cells[_pushedOpponentBhv.X + x, _pushedOpponentBhv.Y + y].GetComponent <CellBhv>().Type == CellType.Impracticable)
            {
                pushedOpponentBhv.LosePm(1);
            }
            return(false);
        }
        _pushedOpponentBhv.AfterMouvementDelegate = AfterPush;
        _pushedOpponentBhv.MoveToPosition(_pushedOpponentBhv.X + x, _pushedOpponentBhv.Y + y, false);
        CharacterBhv.Instantiator.NewEffect(InventoryItemType.Skill, GridBhv.Cells[_pushedOpponentBhv.X + x, _pushedOpponentBhv.Y + y].transform.position, null, EffectId, Constants.GridMax - (_pushedOpponentBhv.Y + y));
        return(true);
    }
コード例 #30
0
ファイル: FightSceneBhv.cs プロジェクト: MaximeRadomski/Rogue
 public override void OnPlayerDeath(CharacterBhv playerBhv)
 {
     playerBhv.SkinContainer.OnDeath();
     Instantiator.PopIcon(Helper.GetSpriteFromSpriteSheet("Sprites/IconsStatus_0"), playerBhv.transform.position);
     base.OnPlayerDeath(playerBhv);
 }