Example #1
0
        public LighterViewModel(ILoot loot, bool is_info) : base(loot, is_info)
        {
            Player          = Player.Instance;
            MakeFireCommand = new Command(MakeFire);

            //CraftItem = new CraftMaterial(ItemFactory.GetItem(ItemTag.Wood), 10, Player.Inventory.GetMaterial(ItemTag.Wood));
        }
Example #2
0
        public RecycleableViewModel(ILoot loot, bool is_info) : base(loot, is_info)
        {
            player = Player.Instance;

            recycleable = loot.Item as Recycleable;
            LootRandom  = GetLootRandoms();
        }
        public void AddLoot(float experience, Vector2 position)
        {
            if (experience == 0f)
            {
                return;
            }
            float droppingExp = (float)Math.Sqrt(experience);
            int   lootCount;

            if (droppingExp < 150f)
            {
                lootCount = (int)Math.Ceiling(droppingExp / 15f);
            }
            else
            {
                lootCount = 10;
            }
            droppingExp /= lootCount;
            for (int i = 0; i < lootCount; i++)
            {
                Vector2 pos = Functions.RandomVector2(minLootDistanceSpawn, maxLootDistanceSpawn) + position;
                Vector2 dir = Functions.RandomVector2();

                ILoot loot = inactiveLootList[inactiveLootList.Count - 1];
                inactiveLootList.RemoveAt(inactiveLootList.Count - 1);
                activeLootList.Add(loot);
                loot.Launch(droppingExp, pos, dir);
            }
        }
Example #4
0
 public void AddLoot(ILoot loot)
 {
     playerState.addLoot(loot);
     if (hud != null)
     {
         hud.UpdatePlayerState(playerState);
     }
 }
Example #5
0
        public RangeWeaponViewModel(ILoot loot, bool is_info) : base(loot, is_info)
        {
            Player          = Player.Instance;
            RepairViewModel = new RepairViewModel(loot, is_info);

            ItemTag tag = (loot.Item as RangeWeapon).Ammo;

            Ammo = new LootItem(ItemFactory.GetItem(tag), Player.Inventory.GetCount(tag));
        }
Example #6
0
        public RepairViewModel(ILoot loot, bool is_info) : base(loot, is_info)
        {
            RepairCommand = new Command(Repair);

            Player     = Player.Instance;
            repairable = loot.Item as IRepairable;

            Repairs = new ObservableCollection <CraftItem>();
            GetRepairs();
        }
Example #7
0
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            ILoot loot = ((CraftItem)item).Loot;

            if (loot is LootOption)
            {
                return(OptionDataTemplate);
            }
            else
            {
                return(MaterialDataTemplate);
            }
        }
Example #8
0
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            ILoot loot = item as ILoot;

            if (loot.Item is IBreakable)
            {
                return(BrockenableDataTemplate);
            }
            else
            {
                return(NormaDataTemplate);
            }
        }
Example #9
0
 public StateInitial(
     SignalBus signalBus,
     IInput input,
     IPath path,
     IBall ball,
     IOpts opts,
     IView gain,
     ILoot loot) : base(input)
 {
     this.signalBus = signalBus;
     this.path      = path;
     this.ball      = ball;
     this.opts      = opts;
     this.gain      = gain;
     this.loot      = loot;
 }
Example #10
0
 public CraftItem(ILoot loot, int count)
 {
     Loot  = loot;
     Count = count;
 }
Example #11
0
        public FishingrodViewModel(ILoot loot, bool is_info) : base(loot, is_info)
        {
            CatchFishCommand = new Command(CatchFish);

            RepairViewModel = new RepairViewModel(loot, is_info);
        }
Example #12
0
 public BookViewModel(ILoot loot, bool is_info) : base(loot, is_info)
 {
     Player      = Player.Instance;
     ReadCommand = new Command(Read);
 }
Example #13
0
 public FlashlightViewModel(ILoot loot, bool is_info) : base(loot, is_info)
 {
     Player          = Player.Instance;
     RepairViewModel = new RepairViewModel(loot, is_info);
 }
Example #14
0
 public MaskViewModel(ILoot loot, bool is_info) : base(loot, is_info)
 {
     EquipViewModel = new EquipViewModel(loot, is_info);
 }
Example #15
0
 internal void addLoot(ILoot loot)
 {
     loot.AddToPlayerState(this);
 }
Example #16
0
 public ArmorViewModel(ILoot loot, bool is_info) : base(loot, is_info)
 {
     EquipViewModel  = new EquipViewModel(loot, is_info);
     RepairViewModel = new RepairViewModel(loot, is_info);
 }
Example #17
0
 public LightViewModel(ILoot loot, bool is_info) : base(loot, is_info)
 {
     Player         = Player.Instance;
     EquipViewModel = new EquipViewModel(loot, is_info);
 }
Example #18
0
 public FoodViewModel(ILoot loot, bool is_info) : base(loot, is_info)
 {
     Player = Player.Instance;
 }
Example #19
0
 public GasMaskViewModel(ILoot loot, bool is_info) : base(loot, is_info)
 {
     RepairViewModel = new RepairViewModel(loot, is_info);
 }
Example #20
0
 public MedecineEffectViewModel(ILoot loot, bool is_info) : base(loot, is_info)
 {
     ConsumeCommand = new Command(Consume);
 }
Example #21
0
 public ActiveItems(ILoot loot)
 {
     string detected_loot = loot.generateLoot();
 }
Example #22
0
 public BagViewModel(ILoot loot, bool is_info) : base(loot, is_info)
 {
     RepairViewModel = new RepairViewModel(loot, is_info);
     EquipViewModel  = new EquipViewModel(Loot, is_info);
 }
Example #23
0
 public Item MakeFire(ILoot loot)
 {
     return(ItemFactory.GetItem(ItemTag.Fire));
 }