public void SetBonus(Bonuses bonusId)
    {
        var spriteName = $"Sprites/{bonusId}";
        var sprite     = Resources.Load <Sprite>(spriteName);

        _spriteBonus.sprite = sprite;
    }
Beispiel #2
0
        public ActionResult Index(FormCollection form)
        {
            Output.Write("Employee Salary Id is: " + BonusesController.EmployeeSalaryId);
            EmployeeSalary employeeSalary = employeeSalaryService.Get(BonusesController.EmployeeSalaryId);
            Bonus          mainBonus      = mainBonusService.Get(employeeSalary.BonusId);
            int            bonusAmount    = Int32.Parse(form["BonusAmount"]);
            Bonuses        bonus          = new Bonuses
            {
                BonusId          = mainBonus.BonusId,
                BonusValue       = bonusAmount,
                BonusDescription = form["BonusReason"]
            };

            Output.Write("Employee Salary Id is: " + employeeSalary.EmployeeSalaryId);
            Output.Write("Bonus id is: " + mainBonus.BonusId);
            Output.Write("Bonus amount is: " + bonusAmount);

            mainBonus.BonusValue += bonusAmount;
            mainBonusService.Update(mainBonus, mainBonus.BonusId);

            bonusComponentService.Insert(bonus);

            //new ServiceFactory().Create<Employee>().GetAll();
            //ServiceFactory.GetCommonViewService().AssignBonusToEmployee(bonus, Int32.Parse(form["EmpId"]));


            return(RedirectToAction("EmployeeDisplay", "EmployeeEvaluations"));
        }
Beispiel #3
0
    public void PerfectHit(IngredientSO ingredient, Transform lastIngredient)
    {
        SetLastIngredient(lastIngredient);

        _allIngredientsOnTheBurger++;
        _countPerfectHIt++;

        //SoundManager.instance.BurgerHitSound();

        if (_countPerfectHIt == _perfectHitToStaggerZero)
        {
            Bonuses.StopStagger();
            GameManager.instance.SetPerfektHitFX(lastIngredient.position + Vector3.up / 6);
            SoundManager.instance.PerfectHitSound();

            _countPerfectHIt = 0;
        }
        else
        {
            SoundManager.instance.PerfectHitTypesSound();
        }

        ingredientHit = Hit.Perfect;
        Score.instance.ChangeScoreWhenHit(GameManager.instance.GetPerfectHitScore(), ingredientHit);
        PlayerControl.instance.HitOnTheBurger();


        _missionManager.MissionDo(Hit.Perfect, ingredient);

        IngredientOnTheBurger(ingredient);
    }
Beispiel #4
0
 public Roller(string name, int val)
 {
     this.name       = name != null ? name : "default";
     this.value      = val;
     this.bonuses    = new Bonuses();
     this.totalBonus = bonuses.getBon();
 }
Beispiel #5
0
 private Direction?SendTick(Player player)
 {
     return(player.Client.SendRequestInput(
                new RequestInput
     {
         tick_num = Tick,
         players = Players.ToDictionary(
             x => x == player ? "i" : x.Id.ToString(),
             x => new RequestInput.PlayerData
         {
             position = x.Pos,
             lines = x.Lines.ToArray(),
             territory = x.Territory.Points.ToArray(),
             direction = x.Dir,
             score = x.Score,
             bonuses = x.Bonuses.Select(
                 b => new RequestInput.BonusState
             {
                 type = b.Type,
                 ticks = b.RemainingTicks
             })
                       .ToArray()
         }),
         bonuses = Bonuses.Select(
             x => new RequestInput.BonusData
         {
             position = x.Pos,
             type = x.Type
         })
                   .ToArray()
     })
            .Command);
 }
Beispiel #6
0
        public override void OnResponse(RelayInfo info)
        {
            if (info.ButtonID >= 100)
            {
                int id = info.ButtonID - 100;

                if (id >= 0 && id < Skills.Length)
                {
                    Selection = Skills[id];

                    SendGump(new GenericConfirmCallbackGump <ApplySkillBonusGump>(User, User.Skills[Selection].Info.Name, 1155611, this, null,
                                                                                  (m, gump) =>
                    {
                        if (gump.Item.IsChildOf(gump.User.Backpack) || gump.User.Items.Contains(gump.Item))
                        {
                            gump.User.SendLocalizedMessage(1155612); // A skill bonus has been applied to the item!
                            Bonuses.SetValues(gump.Index, gump.Selection, gump.Value);

                            gump.Item.InvalidateProperties();
                        }
                    },
                                                                                  (m, gump) =>
                    {
                        gump.Refresh();
                    }));
                }
            }
        }
Beispiel #7
0
 private HashSet <V> GetBusyPoints()
 {
     return(new HashSet <V>(
                Players.Select(x => x.Pos)
                .Concat(Bonuses.Select(x => x.Pos))
                .Concat(Players.SelectMany(x => x.Lines))));
 }
Beispiel #8
0
    public void DropBonus(Bonuses bonusId, Vector2 position)
    {
        // TODO: заменить пулом объектов
        var template = Resources.Load <BonusView>("Prefabs/BonusView");
        var instance = GameObject.Instantiate(template);

        IBonus bonus = new Bonus(bonusId, position, instance);

        _bonuses.Add(bonus);
        bonus.Picked += OnBonusPicked;
        bonus.Over   += OnBonusOver;

        void OnBonusPicked(object sender, EventArgs eventArgs)
        {
            bonus.Picked -= OnBonusPicked;
            BonusPicked?.Invoke(this, bonusId);
            Release(bonus);
        }

        void OnBonusOver(object sender, EventArgs eventArgs)
        {
            bonus.Over -= OnBonusOver;
            Release(bonus);
        }
    }
Beispiel #9
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            //контроллер
            _keyboardController = new KeyboardController(this);

            //игрок
            Player        = new Player(_PlayerTexture);
            Player._laser = _PlayerLaser;
            Player.SetPosition(120, graphics.PreferredBackBufferHeight / 2);
            Player.SetScale(0.5f);
            _keyboardController.Attach(Player);

            //фон
            Background = new Background(_t);

            //астероиды
            _asteroid1 = new Asteroids(_asteroidTexture1, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            _asteroid2 = new Asteroids(_asteroidTexture2, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            _asteroid3 = new Asteroids(_asteroidTexture3, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            _asteroid4 = new Asteroids(_asteroidTexture4, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            _asteroid5 = new Asteroids(_asteroidTexture5, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);

            //бонусы
            _bonusHeals = new Bonuses(_heart);
            _bonusHeals.SetPosition(500, 500);
            _bonusHeals.SetScale(0.6f);
            _bonusHeals.SetVelocity(new Vector2(-1, 0));
        }
Beispiel #10
0
    private void Start()
    {
        switch (Random.Range(0, 4))
        {
        case 0:
            GetComponent <SpriteRenderer>().sprite = DoubleDamageSprite;
            bonus = Bonuses.DoubleDamage;
            value = 5f;
            break;

        case 1:
            GetComponent <SpriteRenderer>().sprite = HeartSprite;
            bonus = Bonuses.Heal;
            value = 10f;
            break;

        case 2:
            GetComponent <SpriteRenderer>().sprite = ShieldSprite;
            bonus = Bonuses.Shield;
            value = 5f;
            break;

        case 3:
            GetComponent <SpriteRenderer>().sprite = ThroughBulletsSprite;
            bonus = Bonuses.ThroughBullets;
            value = 5f;
            break;
        }
    }
Beispiel #11
0
        public override void UpdateGoldValueKoef()
        {
            var mainStatKoef = MainStat.Koef * MainStat.EnchantKoef;
            var bonusesKoef  = Bonuses.GetValueKoef();

            GoldValue.Koef = mainStatKoef * bonusesKoef;
        }
    private void Interact(Vector2 lineOrigin, Vector2 chargePos)
    {
        Interactives.Clear();
        Bonuses.Clear();

        var interactableDetect = Utils.LineCastAll(lineOrigin, chargePos, includeTriggers: true);
        var interactives       = interactableDetect.Where(i => i.transform.CompareTag("Interactive")).ToArray();

        foreach (var interactive in interactives)
        {
            if (interactive.transform.TryGetComponent(out IActivable activable))
            {
                Interactives.Add(activable);
            }
        }

        var bonuses = interactableDetect.Where(b => b.transform.CompareTag("Bonus")).ToArray();

        foreach (var item in bonuses)
        {
            if (item.transform.TryGetComponent(out Bonus bonus))
            {
                Bonuses.Add(bonus);
            }
        }
    }
        public override void AddBonus(uint bonusIndex, Bonus bonus)
        {
            var bonuses = Bonuses.ContainsKey(bonusIndex) ? Bonuses[bonusIndex] : new List <Bonus>();

            bonuses.Add(bonus);
            Bonuses[bonusIndex] = bonuses;
        }
Beispiel #14
0
    int GetFinalValue()
    {
        int finalValue = BaseValue;

        Bonuses.ForEach(value => finalValue += value);
        return(finalValue);
    }
Beispiel #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.Bonus, Request.Cookies["user"]["Permission"].ToString()))
                {
                    Response.Redirect("~/HR/UnAuthorized.aspx");
                }
            }
            Bonuses   bonus = new Bonuses();
            DataTable dt    = bonus.getList();

            ASPxGridView1.DataSource = dt;
            ASPxGridView1.DataBind();
            AddSubmitEvent();
            if (!IsPostBack)
            {
                if (Request.QueryString["alert"] == "success")
                {
                    Response.Write("<script>alert('تم الحفظ بنجاح.');</script>");
                }
            }
        }
Beispiel #16
0
        public void FillBonuses()
        {
            Random random = new Random();

            while (Bonuses.Count < CntBonuses)
            {
                Point position = new Point(random.Next(0, Width), random.Next(0, Height));

                if (IsFreePosition(position, false))
                {
                    double chance = random.NextDouble();

                    if (chance < 0.05)
                    {
                        Bonuses.Add(new GameFieldObject.Bonus.SuperBonus(position));
                    }
                    else if (chance < 0.25)
                    {
                        Bonuses.Add(new GameFieldObject.Bonus.BonusLife(position));
                    }
                    else
                    {
                        Bonuses.Add(new GameFieldObject.Bonus.BonusPoints(position));
                    }
                }
            }
        }
Beispiel #17
0
        public override void OnResponse(RelayInfo info)
        {
            if (info.ButtonID >= 100)
            {
                int id = info.ButtonID - 100;

                if (id >= 0 && id < Skills.Length)
                {
                    Selection = Skills[id];

                    if (Core.TOL) // ERA MAY NEED ADJUSTED FOR CLILOC
                    {
                        SendGump(new GenericConfirmCallbackGump <ApplySkillBonusGump>(User, User.Skills[Selection].Info.Name, 1155611, this, null,
                                                                                      (m, gump) =>
                        {
                            if (gump.Item.IsChildOf(gump.User.Backpack) || gump.User.Items.Contains(gump.Item))
                            {
                                gump.User.SendLocalizedMessage(1155612); // A skill bonus has been applied to the item!
                                Bonuses.SetValues(gump.Index, gump.Selection, gump.Value);

                                gump.Item.InvalidateProperties();
                            }
                        },
                                                                                      (m, gump) =>
                        {
                            gump.Refresh();
                        }));
                    }
                    else
                    {
                        TextDefinition text;

                        if (Item is BaseWeapon)
                        {
                            text = 1155611; // Are you sure you wish to apply the selected skill bonus to this weapon?
                        }
                        else
                        {
                            text = 1155611; // Are you sure you wish to apply the selected skill bonus to this item?
                        }

                        SendGump(new GenericConfirmCallbackGump <ApplySkillBonusGump>(User, User.Skills[Selection].Info.Name, text, this, null,
                                                                                      (m, gump) =>
                        {
                            if (gump.Item.IsChildOf(gump.User.Backpack) || gump.User.Items.Contains(gump.Item))
                            {
                                gump.User.SendLocalizedMessage(1155612); // A skill bonus has been applied to the item!
                                Bonuses.SetValues(gump.Index, gump.Selection, gump.Value);

                                gump.Item.InvalidateProperties();
                            }
                        },
                                                                                      (m, gump) =>
                        {
                            gump.Refresh();
                        }));
                    }
                }
            }
        }
 private void RecalculateBonuses()
 {
     Bonuses.Clear();
     foreach (var inventoryItem in Slots.Values)
     {
         inventoryItem?.Bonuses.ForEach(b => Bonuses.Add(b));
     }
 }
Beispiel #19
0
    public Bonus(Bonuses bonusId, Vector3 position, IBonusView view)
    {
        View = view;
        View.SetBonus(bonusId);
        View.Throw(position, GetThrowedForce());

        View.Collision += OnCollision;
    }
 public void StopStagger()
 {
     if (GameManager.instance.GetScore() >= _staggeringStopCost)
     {
         GameManager.instance.ChangeScore(-_slowDownArrowCost);
         Bonuses.StopStagger();
     }
 }
 public void AddHealtPoint()
 {
     if (GameManager.instance.GetScore() >= _addHealtCost)
     {
         GameManager.instance.ChangeScore(-_slowDownArrowCost);
         Bonuses.AddHealtPoint(1);
     }
 }
 public void SlowDownArrowThrowSpeed()
 {
     if (GameManager.instance.GetScore() >= _slowDownArrowCost)
     {
         GameManager.instance.ChangeScore(-_slowDownArrowCost);
         Bonuses.SlowDownArrowThrowSpeed();
     }
 }
Beispiel #23
0
        public void AddBonus(int value, string condition = "")
        {
            var bonus = new Bonus {
                Value = value, Condition = condition
            };

            Bonuses = Bonuses.Union(new[] { bonus });
        }
Beispiel #24
0
        /// <summary>
        /// <see cref="IGameFieldView.AddBonus(Bonus, Vector2)"/>
        /// </summary>
        public IBonusView AddBonus(Bonus bonusInfo, Vector2 position)
        {
            var bonusView = Instantiate(_bonusPrefab, position, new Quaternion(), this.transform);

            bonusView.BonusParametrs = bonusInfo;
            Bonuses.Add(bonusView);
            return(bonusView);
        }
Beispiel #25
0
 private void GenerateBonus()
 {
     if (Helpers.RandInt(1, Env.BONUS_CHANCE) == 1 && Bonuses.Count < Env.BONUSES_MAX_COUNT)
     {
         var pos   = Bonus.GenerateCoordinates(Players, GetBusyPoints());
         var bonus = availableBonuses.RandArrayItem().Invoke(pos);
         Bonuses.Add(bonus);
     }
 }
Beispiel #26
0
        //---------------------------------------------------------------------------------------------------------
        // GetBonusSprite
        //---------------------------------------------------------------------------------------------------------
        // Gets the correct bonus sprite identifier for the bonus bubble
        //---------------------------------------------------------------------------------------------------------

        public void GetBonusSprite(Bonuses bonusType)
        {
            var spriteName = string.Format("bonus_{0}.png", bonusType);

            BonusSprite             = new CCSprite(BonusSpriteSheet.Frames.Find(x => x.TextureFilename.Equals(spriteName)));
            BonusSprite.AnchorPoint = CCPoint.AnchorMiddle;
            BonusSprite.Opacity     = 0;
            AddChild(BonusSprite, 1);
        }
Beispiel #27
0
        public int GetBonus(EquipableBonusType bonusType)
        {
            if (!Bonuses.ContainsKey(bonusType))
            {
                return(0);
            }

            return(Bonuses[bonusType]);
        }
Beispiel #28
0
        protected override Dictionary <string, object> GetSaveDataContent()
        {
            var data = base.GetSaveDataContent();

            data.Add(SaveKeyBonuses, new DictionarySaveable(Bonuses.ToDictionary(pair => (object)(int)pair.Key, pair => (object)pair.Value)));
            data.Add(SaveKeyStatBonuses, new DictionarySaveable(StatBonuses.ToDictionary(pair => (object)(int)pair.Key, pair => (object)pair.Value)));
            data.Add(SaveKeyLightPower, (int)LightPower);
            data.Add(SaveKeyDescription, Description);
            return(data);
        }
        public IQueryable <Core.Data.Bonus> GetCurrentVersionBonuses()
        {
            var currentIdVersion = Bonuses
                                   .GroupBy(bonus => bonus.Id)
                                   .Select(group => new { Id = group.Key, Version = group.Max(obj => obj.Version) });

            return(Bonuses
                   .Include(bonus => bonus.Statistic)
                   .Where(bonus => currentIdVersion.Contains(new { bonus.Id, bonus.Version })));
        }
Beispiel #30
0
    /// <summary>
    /// Обрабатываем столкновения с другими объектами
    /// </summary>
    void OnTriggerEnter(Collider other)
    {
        switch (other.tag)
        {
        case "Bonuses":
            Bonuses bonus = other.GetComponent <Bonuses>();
            FindObjectOfType <Game>().AddScore(bonus.score);
            switch (bonus.BonusType)
            {
            case Bonuses.TypeBounes.PowerUp:
                foreach (GhostAI g in FindObjectsOfType <GhostAI>())
                {
                    g.ChangeMode(GhostAI.ModeBehavior.outrun);
                }
                MainController.Instance.SoundEatPowerUp.Play();
                break;

            case Bonuses.TypeBounes.Point:
                if (--prm.PointsCount <= 0)
                {
                    FindObjectOfType <Game>().NextLevel();
                }
                MainController.Instance.SoundEatPoint.Play();
                break;

            case Bonuses.TypeBounes.Fruit:
                MainController.Instance.SoundEatFruit.Play();
                break;
            }
            bonus.gameObject.SetActive(false);
            break;

        case "Ghosts":
            GhostAI ghost = other.GetComponent <GhostAI>();
            MainController.Instance.SoundIntermission.Play();
            switch (ghost.BehaviorMode)
            {
            case GhostAI.ModeBehavior.chase:
            case GhostAI.ModeBehavior.around:
                MainController.Instance.SoundDeath.Play();
                FindObjectOfType <Game>().ShowGameMessage(Game.MessageState.kill);
                break;

            case GhostAI.ModeBehavior.outrun:
                ghost.ChangeMode(GhostAI.ModeBehavior.backtobase);
                FindObjectOfType <Game>().AddScore(200);
                MainController.Instance.SoundEatGhost.Play();
                break;

            case GhostAI.ModeBehavior.backtobase:
                break;
            }
            break;
        }
    }
Beispiel #31
0
        public BaseVIPDeed()
            : base(0x14F0)
        {
            this.Weight = 1.0;
            this.LootType = LootType.Blessed;
            this._Tier = VIPTier.None;
            this._Bonuses = new Bonuses();

            for (int i = 0; i < this._Bonuses.Length; i++)
            {
                this._Bonuses[i].Enabled = false;
            }
        }
Beispiel #32
0
        public VIPModule(Mobile from, BaseVIPDeed deed)
            : base()
        {
            this._Canceled = false;
            this._TimeStarted = DateTime.MinValue;
            this._ServicePeriod = TimeSpan.Zero;

            if (deed != null)
            {
                this._Tier = deed.Tier;
                this._Bonuses = deed.Bonuses;
            }

            this.LinkMobile(from);
        }
Beispiel #33
0
 public static Bonuses CreateBonuses(global::System.Guid ID, float amount, int activityID)
 {
     Bonuses bonuses = new Bonuses();
     bonuses.ID = ID;
     bonuses.Amount = amount;
     bonuses.ActivityID = activityID;
     return bonuses;
 }
Beispiel #34
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    {
                        this._Tier = (VIPTier)reader.ReadByte();
                        this._Bonuses = new Bonuses(reader);
                        break;
                    }
            }
        }
Beispiel #35
0
 public void DeleteBonus(Bonuses BonusesToDelete)
 {
     this.Bonuses.Remove(BonusesToDelete);
     this.SaveChanges();
 }
Beispiel #36
0
 public int UpdateBonus(Bonuses UpdatedBonuses)
 {
     var a = this.Bonuses.Find(UpdatedBonuses.ID);
     //throw exception надо писать?
     a.Amount = UpdatedBonuses.Amount;
     a.ActivityID = UpdatedBonuses.ActivityID;
     int rowsAffected = this.SaveChanges();
     return rowsAffected;
 }
Beispiel #37
0
 /* CREDO for Bonuses table */
 public int AddBonus(Bonuses NewBonus)
 {
     NewBonus.ID = Guid.NewGuid();
     this.Bonuses.Add(NewBonus);
     int rowsAffected = this.SaveChanges();
     return rowsAffected;
 }
Beispiel #38
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    {
                        this._Canceled = reader.ReadBool();
                        this._TimeStarted = reader.ReadDateTime();
                        this._ServicePeriod = reader.ReadTimeSpan();
                        this._Bonuses = new Bonuses(reader);
                        break;
                    }
            }
        }
Beispiel #39
0
 public void AddToBonuses(Bonuses bonuses)
 {
     base.AddObject("Bonuses", bonuses);
 }