コード例 #1
0
ファイル: Actor.cs プロジェクト: darkhunterbg/RushForDawn
        public void Init()
        {
            foreach (var a in Abilities)
            {
                Destroy(a.gameObject);
            }

            Abilities.Clear();

            ActiveBuffs.Clear();

            foreach (var a in AbilityDefinisions)
            {
                Abilities.Add(Instantiate(a, this.transform));
            }

            foreach (var a in Abilities)
            {
                a.User = this;
            }

            _damageTimer = _damageAccumulator = 0;
            _blockTimer  = _damageAccumulator = 0;
            _blockTimer  = _blockAccumulator = 0;
            _deathTimer  = 0;

            NewTurn();
        }
コード例 #2
0
 internal void SetProperty(FRAME frame, PROPERTY property, bool setLogic = true)
 {
     this.Frame = frame;
     if (setLogic)
     {
         if (this.IsMonster())
         {
             ScaleLeft  = ScaleRight = ATK = DEF = Level = Rank = -1;
             IsPendulum = false;
             Attribute  = Frame == FRAME.Spell ? ATTRIBUTE.SPELL : ATTRIBUTE.TRAP;
             Abilities.Clear();
             Property = PROPERTY.Normal;
             Type     = TYPE.NONE;
         }
         else
         {
             if (property.IsSpellPropertyOnly())
             {
                 Attribute = ATTRIBUTE.SPELL;
                 //_Frame = FRAME.Spell;
             }
             else if (property.IsTrapPropertyOnly())
             {
                 Attribute = ATTRIBUTE.TRAP;
                 //_Frame = FRAME.Trap;
             }
         }
     }
     Property = property;
 }
コード例 #3
0
        public void SetSelection(Actor selection)
        {
            if (SelectedActor == selection)
            {
                return;
            }

            SelectedActor?.SetNormalState();

            SelectedActor = selection;


            foreach (var ability in Abilities)
            {
                Destroy(ability.gameObject);
            }

            Abilities.Clear();


            if (selection)
            {
                SelectedActor.SetSelectedState();

                foreach (var ability in selection.Abilities)
                {
                    var obj = Instantiate(AbilityPrefab, AbiltyBar);
                    obj.SetAbility(ability);
                    obj.OnClicked += AbilityClicked;
                    Abilities.Add(obj);
                }
            }
        }
コード例 #4
0
        public void Unload()
        {
            Log.Info(Log.LogSource.PoxDB, "Database.Unload() called");
            if (!ready)
            {
                return;
            }
            // todo: what if it is loading?

            Champions.Clear();
            Abilities.Clear();
            Abilities_similar.Clear();
            Spells.Clear();
            Relics.Clear();
            Equipments.Clear();

            Factions.Clear();
            Races.Clear();
            Classes.Clear();
            Rarities.Clear();
            Expansions.Clear();
            AbilityNames.Clear();

            ready = false;
        }
コード例 #5
0
 private void LoadExistingData()
 {
     Abilities.Clear();
     foreach (var loaded in _moduleDataService.LoadAll <AbilityData>())
     {
         var ability = _observableDataFactory.CreateAndMap <AbilityDataObservable, AbilityData>(loaded);
         Abilities.Add(ability);
     }
 }
コード例 #6
0
        public void SetAttribute(ATTRIBUTE attribute, bool setLogic = true)
        {
            if (setLogic)
            {
                //Card is Monster
                if (this.IsMonster())
                {
                    if (attribute == ATTRIBUTE.SPELL || attribute == ATTRIBUTE.TRAP)
                    {
                        ScaleLeft  = ScaleRight = ATK = DEF = Level = Rank = -1;
                        IsPendulum = false;
                        Frame      = (attribute == ATTRIBUTE.SPELL) ? FRAME.Spell : FRAME.Trap;
                        Abilities.Clear();
                        Property = PROPERTY.Normal;
                        Type     = TYPE.NONE;
                    }
                }
                //Card is Spell/Trap
                else
                {
                    //From Trap To Spell
                    if (attribute == ATTRIBUTE.SPELL)
                    {
                        Frame = FRAME.Spell;
                        if (Property.IsTrapPropertyOnly())
                        {
                            Property = PROPERTY.Normal;
                        }
                    }
                    //From Spell To Trap
                    else if (attribute == ATTRIBUTE.TRAP)
                    {
                        Frame = FRAME.Trap;
                        if (Property.IsSpellPropertyOnly())
                        {
                            Property = PROPERTY.Normal;
                        }
                    }
                    //To Monster
                    else
                    {
                        ScaleLeft = ScaleRight = ATK = DEF = double.NaN;
                        Frame     = DefaultFrame;
                        Property  = PROPERTY.NONE;
                        Level     = 4; //Default Level
                        Type      = TYPE.NONE;
                    }
                }
            }

            this.Attribute = attribute;
        }
コード例 #7
0
        /// <summary>
        /// Removes any space objects, etc. that the current empire cannot see.
        /// </summary>
        /// <param name="galaxy">The galaxy, for context.</param>
        public void Redact(Empire emp)
        {
            // hide explored-by empires
            foreach (var e in ExploredByEmpires.Where(e => e != emp).ToArray())
            {
                ExploredByEmpires.Remove(e);
            }

            // hide background image and description (so player can't see what kind of system it is) and name and abilities
            if (!ExploredByEmpires.Contains(emp))
            {
                BackgroundImagePath = null;
                Name        = "(Unexplored)";
                Description = "An unexplored star system. Who knows what lies in wait here?";
                Abilities.Clear();
            }
        }
コード例 #8
0
        public void SetFrame(FRAME frame, bool setLogic = true)
        {
            if (setLogic)
            {
                //Card is Monster
                if (this.IsMonster())
                {
                    //To Spell/Trap
                    if (frame == FRAME.Spell || frame == FRAME.Trap)
                    {
                        ScaleLeft  = ScaleRight = ATK = DEF = Level = Rank = -1;
                        IsPendulum = false;
                        Attribute  = frame == FRAME.Spell ? ATTRIBUTE.SPELL : ATTRIBUTE.TRAP;
                        Abilities.Clear();
                        Property = PROPERTY.Normal;
                        Type     = TYPE.NONE;
                    }

                    if (Abilities.Contains(ABILITY.Effect) && frame == FRAME.Effect)
                    {
                        Abilities.Remove(ABILITY.Effect);
                    }
                    //To Xyz
                    if (frame == FRAME.Xyz && Frame != FRAME.Xyz)
                    {
                        Level = double.NaN;
                        Rank  = 4;
                    }
                    //To Non-Xyz
                    if (frame != FRAME.Xyz && Frame == FRAME.Xyz)
                    {
                        Rank  = double.NaN;
                        Level = 4;
                    }
                    if (frame == FRAME.Normal)
                    {
                        Abilities.Clear();
                    }
                }
                //Card is Spell/Trap
                else
                {
                    //From Trap To Spell
                    if (frame == FRAME.Spell)
                    {
                        Attribute = ATTRIBUTE.SPELL;
                        if (Property.IsTrapPropertyOnly())
                        {
                            Property = PROPERTY.Normal;
                        }
                    }
                    //From Spell To Trap
                    else if (frame == FRAME.Trap)
                    {
                        Attribute = ATTRIBUTE.TRAP;
                        if (Property.IsSpellPropertyOnly())
                        {
                            Property = PROPERTY.Normal;
                        }
                    }
                    //To Monster
                    else
                    {
                        ScaleLeft = ScaleRight = ATK = DEF = double.NaN;
                        Attribute = ATTRIBUTE.UNKNOWN;
                        Property  = PROPERTY.NONE;
                        Level     = 4; //Default Level
                    }
                }
            }
            this.Frame = frame;
        }
コード例 #9
0
 private void ModuleClosed()
 {
     Abilities.Clear();
 }