Exemplo n.º 1
0
        private bool SucceedsInvItem(InvItem inv1, InvItem inv2)
        {
            ItemData entry1 = DataManager.Instance.GetItem(inv1.ID);
            ItemData entry2 = DataManager.Instance.GetItem(inv2.ID);

            if (entry1.UsageType > entry2.UsageType)
            {
                return(true);
            }
            else if (entry1.UsageType < entry2.UsageType)
            {
                return(false);
            }
            return(inv1.ID >= inv2.ID);
        }
Exemplo n.º 2
0
 public BattleContext(BattleContext other, bool copyGlobal) : base(other)
 {
     TurnCancel = other.TurnCancel;
     if (copyGlobal)
     {
         GlobalContextStates = other.GlobalContextStates.Clone();
     }
     else
     {
         GlobalContextStates = other.GlobalContextStates;
     }
     StrikeStartTile = other.StrikeStartTile;
     StrikeEndTile   = other.StrikeEndTile;
     StartDir        = other.StartDir;
     ExplosionTile   = other.ExplosionTile;
     TargetTile      = other.TargetTile;
     if (copyGlobal)
     {
         StrikeLandTiles = new List <Loc>();
         StrikeLandTiles.AddRange(other.StrikeLandTiles);
     }
     else
     {
         StrikeLandTiles = other.StrikeLandTiles;
     }
     ActionType   = other.ActionType;
     UsageSlot    = other.UsageSlot;
     StrikesMade  = other.StrikesMade;
     Strikes      = other.Strikes;
     HitboxAction = other.HitboxAction.Clone();
     Explosion    = new ExplosionData(other.Explosion);
     Data         = new BattleData(other.Data);
     Item         = new InvItem(other.Item);
     SkillUsedUp  = other.SkillUsedUp;
     actionMsg    = other.actionMsg;
     actionSilent = other.actionSilent;
     Hit          = other.Hit;
     RangeMod     = other.RangeMod;
 }
Exemplo n.º 3
0
        public void UpdateInv(InvItem oldItem, InvItem newItem)
        {
            bool update = false;

            if (oldItem != null)
            {
                ItemData itemEntry = DataManager.Instance.GetItem(oldItem.ID);
                if (itemEntry.BagEffect)
                {
                    update = true;
                }
            }
            if (newItem != null)
            {
                ItemData itemEntry = DataManager.Instance.GetItem(newItem.ID);
                if (itemEntry.BagEffect)
                {
                    update = true;
                }
            }
            if (oldItem == null && newItem == null)
            {
                update = true;
            }
            if (update)
            {
                foreach (Character chara in Players)
                {
                    chara.RefreshTraits();
                }
                foreach (Character chara in Guests)
                {
                    chara.RefreshTraits();
                }
            }
        }
Exemplo n.º 4
0
 public MapItem(InvItem item) : this(item, new Loc())
 {
 }
Exemplo n.º 5
0
 public void AddToInv(InvItem invItem)
 {
     inventory.Add(invItem);
     UpdateInv(null, invItem);
 }
Exemplo n.º 6
0
 public InvItem(InvItem other) : base(other)
 {
     Cursed      = other.Cursed;
     HiddenValue = other.HiddenValue;
 }