public Rock(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, Rectangle.Empty, //Source sprite Vector2.Zero, //Speed Vector2.One, null) { //Stats hp = 3; points = 1000; this.icon = RandomMachine.GetRandomInt(0, 3); if (this.icon == 3) this.icon = 1; //HACK sRect = new Rectangle(0 + (128 * icon), 0, 128, 128); dRect = ComputeDstRect(sRect); speedYBis = 0f; if (this.icon != 2) { visualRotation = 0f; } UseRotationWhenDrawing = true; UseSpriteOrigin(); this.hitbox = new CircleHitbox(this, true,2f); this.Background = true; }
public PingouinLauncher(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 256, 192), //Source sprite Vector2.Zero, //Speed Vector2.One, null) { //Stats hp = 251; points = 5000; Difficulty = 20; this.Background = true; shotlocation = new Vector2(105, 180); this.ttl = InfiniteTimeToLive; this.hitbox = new SquareHitbox(this, new Vector2(0.25f, 0.25f)); base.Weapon = new PingouinLauncherWeapon(this); bunker1Rect = new Rectangle(220, 0, 580, 240); soliRect = new Rectangle(8, 500, 57, 100); bunker2Rect = new Rectangle(220, 240, 580, 240); bumper1Rect = new Rectangle(0, 0, 225, 240); bumper2Rect = new Rectangle(0, 240, 225, 240); }
public Avalanche(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 610, 768), //Source sprite Vector2.Zero, //Speed Vector2.One, //Scale null //Weapon) { //Stats this.hp = Int32.MaxValue; this.points = 0; this.Difficulty = 0; this.Background = false; this.Removable = false; this.UseAnimation = true; //Will change later this.totalFrameNumber = 3; this.frameCooldown = 75f; this.spriteBox = new Vector2(613, 768); this.firstStepPassed = false; this.endLevel = false; this.hitbox = new PositionedCircleHitbox(this, new Vector2(-450, 730), 900, false, 1); this.ttl = InfiniteTimeToLive; }
public PoulpiMexico(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flip,flags) { this.sRect = new Rectangle(0, 0, 320, 320); this.dRect = ComputeDstRect(sRect); this.spriteBox = new Vector2(320, 320); }
public Canon(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 136, 104), //Source sprite Vector2.Zero, //Speed Vector2.One, new CanonWeapon()) { this.canonSrc = new Rectangle(135, 0, 121, 78); this.canonCenter = new Vector2(80, 42); this.structureLinkPoint = new Vector2(84, 38); //Canon center has to be on this point //Stats this.hp = 150; this.Difficulty = 50; this.points = 2500; this.ttl = Entity.InfiniteTimeToLive; this.Background = true; this.firstReactorRelativeLoc = new Vector2(41, 98); this.secondReactorRelativeLoc = new Vector2(107, 98); this.Hitbox = new CircleHitbox(this, true); ((CanonWeapon)this.wpn).Parent = this; this.UseRotationWhenDrawing = false; }
public BonusInfo(Bonus B , string name, string state, int price, bool achat ) { this.B = B; this.name = name; this.state = state; this.price = price; this.achat = achat; }
public void Show(Vector3 newPosition, Bonus bonusType) { destroyTimer = ms.otherTime + destroyRate; type = bonusType; mr.material.SetTexture("_MainTex", ms.bonusTextures[(int)type]); renderer.enabled = true; collider.enabled = true; transform.position = newPosition; }
public void Draw(SpriteBatch spriteBatch, Shape shape, Bonus bonus, Vector2 location, float opacity) { int column = (int)shape - 1; int row = (int)bonus; if (column != -1) { base.Draw(spriteBatch, location, row, column, opacity); } }
// Use this for initialization void Start() { paddle = GameObject.FindObjectOfType<Paddle>(); bonus = GameObject.FindObjectOfType<Bonus>(); paddleToBallVector = this.transform.position - paddle.transform.position; booingAudio = GetComponent<AudioSource>(); SetNormalTail(); swapMaterial = gameObject.GetComponent<TrailRenderer>().materials[0]; }
Bonus findActiveBonusOfType(Bonus bonus) { foreach (Bonus b in activeBonuses) { if (b.GetType() == bonus.GetType()) return b; } return null; }
public void init(Bonus activeBonus) { bonus = activeBonus; transform.GetComponentInChildren<BonusTimeLeftBar>().Bonus = bonus; Sprite bonusIcon = bonus.transform.FindChild("bonusIcon").GetComponent<SpriteRenderer>().sprite; transform.FindChild("bonusIcon").GetComponent<Image>().sprite = bonusIcon; initialized = true; }
public bool CreateBonus(Bonus instance) { if (instance.id == 0) { Db.Bonus.InsertOnSubmit(instance); Db.Bonus.Context.SubmitChanges(); return true; } return false; }
public PoulpiSnow(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flip, flags) { this.sRect = new Rectangle(0, 0, 350, 300); this.spriteBox = new Vector2(350, 300); this.hp *= 2; this.Difficulty *= 2; this.Scale = new Vector2(0.3f, 0.3f); this.Weapon = new PoulpiSnowWeapon(); }
public void procBonusEnd(PlayerObject player) { if(activeBonus != null) { activeBonus.end(player); if(activeBonus.isEnd()) activeBonus = null; } }
public bool UpdateBonus(Bonus instance) { Bonus cache = Db.Bonus.Where(p => p.id == instance.id).FirstOrDefault(); if (cache != null) { //TODO : Update fields for Bonus Db.Bonus.Context.SubmitChanges(); return true; } return false; }
public Pepito(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 310, 218), //Source sprite new Vector2(100.0f, 100.0f), //Speed new Vector2(0.35f, 0.35f), new PepitoWeapon()) { hp = 12; points = 3000; Difficulty = 20; }
public PoulpiKnight(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flip, flags) { this.sRect = new Rectangle(0, 0, 350, 320); this.dRect = ComputeDstRect(sRect); this.spriteBox = new Vector2(350, 320); this.speed.Y = 250; this.wpn = new PoulpiKnightWeapon(); this.hp *= 3; }
public SapinLauncher(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, Rectangle.Empty, //Source sprite Vector2.Zero, //Speed Vector2.One, null) { cooldown = 1500; ttl = InfiniteTimeToLive; hitbox = new Hitbox.EmptyHitbox(this); hp = Int32.MaxValue; }
public Pirate(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 520, 390), //Source sprite new Vector2(100.0f, 100.0f), //Speed Vector2.One, new PirateWeapon()) { //Stats hp = 50; points = 1000; Difficulty = 100; }
public Bonus(Bonus another) { power = another.power; magicPower = another.magicPower; maxWeight = another.maxWeight; maxCrewSpace = another.maxCrewSpace; attraction = another.attraction; maxPassengerSpace = another.maxPassengerSpace; maxSpeed = another.maxSpeed; equipmentDurability = another.equipmentDurability; repairPricePercent = another.repairPricePercent; tradePricePercent = another.tradePricePercent; }
public SampleCube(Vector3 position) : base(position) { this.life = 100; this.name = "Sample Cube"; this.Power = 20; Bonus bonus = new Bonus {type = typeof(Cube), bonus = 0}; this.BonusObjects.Add(bonus); model = cubeModel; texture = sampleTex; }
public bool AddItem(Bonus newItem) { for(int i=0;i<3;i++) { if(items[i] == null) { items[i] = newItem; return true; } } return false; }
public ActionResult CreateBonus(Bonus bonus,long workerId) { var model = new LongWorkerModel(); try { model = dbOperations.AddBonus(bonus, workerId); } catch (Exception err) { // ViewBag.Error = err.Message; } return PartialView("WorkerPartial",model); }
public PoulpiFrozen(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 198 ,170), //Source sprite Vector2.Zero, //Speed new Vector2(0.75f,0.75f), null) { //Stats hp = 30; points = 1500; Difficulty = 3; this.Background = true; this.hitbox = new SquareHitbox(this, new Vector2(0.2f, 0.1f)); }
public McBernickZombie(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 634, 600), //Source sprite new Vector2(75.0f, 15.0f), //Speed new Vector2(0.25f, 0.25f), null) { //Common stats hp = 50; points = 10000; Difficulty = 6; this.ttl = 60000; this.hitbox = new CircleHitbox(this, false, 1.75f); }
public user() { rnd = new Random(); random = new Random(); Action A = new Action(this); News N = new News(this); Bonus B = new Bonus( this ); Argent Ar = new Argent( this ); Employer E = new Employer( this ); action = A; news = N; bonus = B; argent = Ar; employer = E; }
public void handleBonus(Bonus bonus) { Bonus activeBonus = findActiveBonusOfType(bonus); if (activeBonus) { activeBonus.TimeLeft += bonus.Duration + bonus.Duration * player.Stats.IncreasedBonusDuration; bonus.destroy(); } else { activeBonuses.Add(bonus); bonusesPanel.addBonus(bonus); bonus.TimeLeft = bonus.Duration + bonus.Duration * player.Stats.IncreasedBonusDuration; bonus.activate(); } }
public Pumpkin(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 256, 256), //Source sprite Vector2.Zero, //Speed new Vector2(0.5f,0.5f), null) { //Stats hp = 60; points = 1200; Difficulty = 10; hitCooldown = 0f; this.hitbox = new SquareHitbox(this, new Vector2(0.25f,0.25f)); this.bombed = false; this.Background = true; }
public Trainee(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 512, 1024), //Source sprite new Vector2(150.0f, 150.0f), //Speed new Vector2(0.25f, 0.25f), null) { //Stats hp = 30; points = 2000; Difficulty = 1; this.InfiniteMovePattern = true; this.hitbox = new SquareHitbox(this,new Vector2(0.3f,0.1f)); this.cooldown = 0f; }
public EtoileMer(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 256, 256), //Source sprite new Vector2(300, 300), //Speed new Vector2(0.25f,0.25f), null) { hp = 10; points = 1500; Difficulty = 20; this.UseRotationWhenDrawing = true; this.visualRotation = 0f; this.UseSpriteOrigin(); this.hitbox = new CircleHitbox(this, true); }
public void NewCowCollected() { cowsCount++; cowsPlacedCount++; if (cowsCount >= model.WinCondition) { gameInputHandler.Block = true; if (onGameOver != null) { onGameOver(); } return; } if (cowsPlacedCount >= applicationManager.Settings.BonusCowsCount) { cowsPlacedCount = 0; Bonus bonus = applicationManager.GameView.CreateBonus(); bonus.Collected += CollectedBonus; } }
private void button3_Click(object sender, EventArgs e) { int bonusId = Convert.ToInt32(comboBox1.SelectedValue); Bonus bonus = db.Bonus.Find(bonusId); DateTime To = bonus.Date; DateTime From = To.AddYears(-1); int id = Convert.ToInt32(comboBox3.SelectedValue); List <Employee> employeesALL = db.Employees.Where(a => a.Section.DepartmentId == id).ToList(); List <Employee> employees = employeesALL.Where(a => a.IsActive(To) && a.IsEdited == true).ToList(); PopulateGrid(employees); //try //{ // PopulateGrid(employees); //} //catch //{ //} }
public async Task <BonusDto> AddBonusAsync(BonusDto model) { try { var bonus = new Bonus { BonusName = model.BonusName, Amount = model.Amount, }; var bonusentity = await context.AddAsync(bonus); await context.SaveChangesAsync(); var a = bonusentity.Entity; model.BonusName = a.BonusName; model.Amount = a.Amount; return(model); } catch (Exception) { throw; // new Exception("The process was not successful"); } }
public async Task <Contract> AplicaBonus(Bonus bonus) { if (bonus == null) { throw new ArgumentNullException("Bonusul este null"); } if (bonus.Contract == null) { throw new ArgumentNullException("Contractul este null"); } Contract contract = bonus.Contract; if (contract.Abonament.AbonamentDate != null) { contract.Abonament.AbonamentDate.Where(date => date.TipDate == bonus.TipBonus).FirstOrDefault().NumarDate = (int)contract.Abonament.AbonamentDate.Where(date => date.TipDate == bonus.TipBonus).Sum(date => date.NumarDate + bonus.DateBonus); } if (contract.Abonament.AbonamentMinute != null) { contract.Abonament.AbonamentMinute.Where(minute => minute.TipMinute == bonus.TipBonus).FirstOrDefault().NumarMinute = (int)contract.Abonament.AbonamentMinute.Where(minute => minute.TipMinute == bonus.TipBonus).Sum(minute => minute.NumarMinute + bonus.MinuteBonus); } if (contract.Abonament.AbonamentSms != null) { contract.Abonament.AbonamentSms.Where(sms => sms.TipSms == bonus.TipBonus).FirstOrDefault().NumarSms = (int)contract.Abonament.AbonamentSms.Where(sms => sms.TipSms == bonus.TipBonus).Sum(sms => sms.NumarSms + bonus.SmsBonus); } await this.contractRepository.Update(contract); return(contract); }
private void IncreasePaddleLenght(Bonus bonus) { if (paddleController != null) { var paddle = paddleController.paddleModel; if (paddle.isGrowed) { return; } paddle.IncreasePaddleSize(); if (currentBonuses.Contains(bonus)) { currentBonuses.Remove(bonus); poolBonuses.Enqueue(bonus); } coreUI.StartBonusTimer(Constants.BONUS_TIME, () => { paddle.DecreasePaddleSize(); }); } }
public virtual async Task <bool> AddDepartmentWideBonus(int departmentId, Bonuses bonus) { try { EmployeeSalaryRepository empSalRepo = new EmployeeSalaryRepository(); BonusRepository bonusRepo = new BonusRepository(); BonusesRepository bonusesRepo = new BonusesRepository(); var salaryBonus = from empSal in empSalRepo.GetAll().Result join bon in bonusRepo.GetAll().Result on empSal.BonusId equals bon.BonusId select new { BonusId = empSal.BonusId }; foreach (var item in salaryBonus) { Bonuses bonusesItem = new Bonuses(); bonusesItem.BonusId = item.BonusId; bonusesItem.BonusValue = bonus.BonusValue; bonusesItem.BonusDescription = bonus.BonusDescription; bonusesItem.BonusesDate = bonus.BonusesDate; await bonusesRepo.Insert(bonusesItem); Bonus tempBonus = bonusRepo.Get(item.BonusId).Result; tempBonus.BonusValue += bonus.BonusValue; await bonusRepo.Update(tempBonus, item.BonusId); } return(true); } catch (Exception e) { Console.WriteLine(e); return(false); } }
public void OnResetClick() { ScavengerHuntArea scavHunt = GameObject.Find("ScavengerHuntPanel").GetComponent <ScavengerHuntArea>(); Timer timer = GameObject.Find("Timer").GetComponent <Timer>(); if (timer.timeInSeconds > 10) { timer.timeInSeconds -= 10; } Bonus bonus = GameObject.Find("ScoreTimerEquationHistoryPanel").GetComponent <Bonus>(); if (GameObject.Find("bonusTimer") != null) { BonusTimer bt = GameObject.Find("bonusTimer").GetComponent <BonusTimer>(); bt.timeInSeconds = 0; bt.bonusOver = true; } bonus.pickRandomBonus(); scavHunt.populateScavHunt(40); }
public void UpdateValue() { float temp = 0; seq.Append(DOVirtual.Float(_slider.value, LocalScore / StepToNext, 0.5f, temp => { _slider.value = temp; }).OnComplete(delegate { if (LocalScore / StepToNext >= 1) { Bonus tempBonus = BonusController.Instance.GetRandomBonus(); Alerts.AlertCall.CallYesNoAlert(() => { tempBonus.Count++; }, () => { tempBonus.Count += 3; }, Res.lang.Confirmation[8], tempBonus.MainSprite, tort, Res.lang.WonBonus, Res.lang.Confirmation[9], Res.lang.Confirmation[10]); LocalScore = LocalScore - StepToNext; _slider.DOValue(LocalScore / StepToNext, 0.5f); _slider.value = 0; int index = Random.Range(0, colors.Count); _slider.transform.GetChild(1).GetChild(0).GetComponent <Image>().DOColor(UpdateColors(index), 0.3f); _slider.transform.GetChild(3).GetComponent <Image>().DOColor(UpdateColors(index), 0.3f); } })); for (int i = 1; i < 6; i++) { DOVirtual.DelayedCall(i * 0.1f, delegate { Vibration.Light(); }); } }
public void Update() { if (_isTwoClick) { if (_currentBonus != null) { pressMe.Stop(); _currentBonus.InActive(); _isActiveBonus = true; _currentBonus = null; } _isClick = false; _isTwoClick = false; } if (_isClick) { TwoClick(); } else { OneClick(); } }
public async Task <ServiceResponse> AddBonus(AddBonusDto bonusDto, string userId) { var service = await _context.Services.FirstOrDefaultAsync(x => x.Id == bonusDto.ServiceId); if (service == null) { return(null); } var user = await _context.Users.Include(x => x.ServiceBonuses).FirstOrDefaultAsync(x => x.Id == Guid.Parse(userId)); if (user == null) { return(null); } // Bonus already exists for this user if (user.ServiceBonuses.Any(x => x.ServiceId == bonusDto.ServiceId)) { throw new Exception("Conflict"); } var bonus = new Bonus { ServiceId = service.Id, UserId = user.Id }; await _context.ServiceBonuses.AddAsync(bonus); await _context.SaveChangesAsync(); var result = await _context.Services.Include(x => x.UserBonuses).ThenInclude(y => y.User).FirstOrDefaultAsync(x => x.Id == service.Id); return(result?.ToDTO()); }
public void CreateBonus(AddBonusViewModel addBonusViewModel) { Guid cToken = Guid.Parse(addBonusViewModel.companyToken); var company = _context.Company.Where(c => c.Token == cToken).FirstOrDefault(); if (company == null) { return; } Bonus bonus = new Bonus() { CreatedOn = DateTime.Now, Description = addBonusViewModel.description, ExpirationDateTime = addBonusViewModel.expirationDate, ImageUrl = addBonusViewModel.imageUrl, Name = addBonusViewModel.name, QuantBonus = addBonusViewModel.quantBonus, CompanyId = company.CompanyId }; _context.Bonus.Add(bonus); _context.SaveChanges(); }
public async Task <IActionResult> Create([Bind("Id,Year,Month,CreatedDate,CreatedBy,EmployeeInfoId,BonusTypeId")] BonusViewModel bonus) { if (ModelState.IsValid) { var userId = httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value; Bonus bb = new Bonus() { Year = bonus.Year, Month = bonus.Month, CreatedBy = userId, CreatedDate = DateTime.Now, EmployeeInfoId = bonus.EmployeeInfoId, BonusTypeId = bonus.BonusTypeId }; await bonusRepository.Save(bb); //_context.Add(bonus); //await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BonusTypeId"] = new SelectList(bonusTypeRepository.GetBonusTypeList(), "Id", "Id", bonus.BonusTypeId); ViewData["EmployeeInfoId"] = new SelectList(employeeInfoRepository.GetEmployeeInfoList(), "Id", "Id", bonus.EmployeeInfoId); return(View(bonus)); }
public void CreateBonus(Vector2 postion) { if (poolBonuses.Count > 0) { var poolBonus = poolBonuses.Dequeue(); var randomBonus = UnityEngine.Random.Range(0, 4); var sprite = spriteDict[randomBonus]; var action = bonusActions[randomBonus]; poolBonus.SetBonusSettings(sprite, action, postion); currentBonuses.Add(poolBonus); } else { Vector2 position = postion; Quaternion rotation = new Quaternion(); var tempBonus = GameObject.Instantiate(bonusPrefab, position, rotation); var randomBonus = UnityEngine.Random.Range(0, 4); var sprite = spriteDict[randomBonus]; var action = bonusActions[randomBonus]; var bonus = new Bonus(tempBonus, sprite, action); currentBonuses.Add(bonus); } }
public Cow(Vector2 loc, Vector2 scroll, Bonus bonus, MovePattern pattern, SpriteEffects flip, String[] flags) : base(loc, scroll, bonus, pattern, flags, flip, new Rectangle(0, 0, 250, 178), //Source sprite Vector2.Zero, //Speed Vector2.One, null ) { //Stats hp = 17; points = 1000; Difficulty = 1; this.Background = true; UseAnimation = true; this.totalFrameNumber = 3; this.frameCooldown = 2000; this.spriteBox = new Vector2(256, 256); this.currentFrame = RandomMachine.GetRandomInt(0, 2); this.ttl = InfiniteTimeToLive; this.hitbox = new CircleHitbox(this, false, 2f); }
public async Task <ActivateBonusResponse> Handle(ActivateBonusRequest request, CancellationToken cancellationToken) { if (!string.IsNullOrEmpty(request.RequestModel.PromoCode) && !promoCodeRepo.Query().Any(a => a.Name == request.RequestModel.PromoCode)) { throw new NotFoundException("Promo code invalid."); } var service = serviceRepo.ReadById(request.RequestModel.ServiceId); if (service == null) { throw new NotFoundException("Service not found."); } var user = UserLogic.GetUserByEmailAddress(currentUser.GetEmailAddress(), userRepo); var bonus = new Bonus(); var promoCode = promoCodeRepo.Query().SingleOrDefault(a => a.Name == request.RequestModel.PromoCode); bonus.PromoCodeId = promoCode?.PromoCodeId; bonus.UserId = user.UserId; bonus.ServiceId = service.ServiceId; bonus.Amount = promoCode?.Amount; bonus.IsActivated = true; bonus.ActivationDateTimeOffset = DateTime.Now; if (await bonusRepo.CreateAsync(bonus, cancellationToken) != 1) { throw new NotFoundException("Bonus data could not be found."); } return(new ActivateBonusResponse { ResponseModel = mapper.Map <ServiceResponseModel>(service) }); }
public static Bonus <float> GetManagerPointChange(GameEntity company, GameContext gameContext) { var teams = company.team.Teams; var bonus = new Bonus <float>("Point gain"); bool teamsOnly = teams.Count > 3; foreach (var team in teams.Where(t => t.isIndependentTeam)) { var b = GetTeamCostForParentTeam(team, company, gameContext, false); if (teamsOnly) { bonus.Append(team.Name, b.Sum()); } else { bonus.AddBonus(b); } } return(bonus); }
public virtual void AddBonus(uint bonusIndex, Bonus bonus) { }
void Collision(Collectible collectible) { switch (gameState) { case GameState.Title: { collectible.Splash(); Shader.SetGlobalVector("_SplashPosition", collectible.position); AudioSource.PlayClipAtPoint(clipCollision, Camera.main.transform.position); break; } case GameState.Playing: { if (collectible.GetType() == typeof(Bonus)) { collectible.Splash(); gui.SetScore(++currentScore, playerLife); Shader.SetGlobalVector("_SplashPosition", collectible.position); AudioSource.PlayClipAtPoint(clipCollision, Camera.main.transform.position); // Win check --currentBonusCount; if (currentBonusCount <= 0) { GotoTransition(); AudioSource.PlayClipAtPoint(clipWin, Camera.main.transform.position); } // Get Life Bonus bonus = (Bonus)collectible; if (bonus.type == Bonus.BonusType.Heart) { ++playerLife; gui.SetScore(currentScore, playerLife); } } else { collectible.Splash(); Shader.SetGlobalVector("_SplashPosition", collectible.position); // Game over check --playerLife; if (playerLife < 0f) { GotoOver(); AudioSource.PlayClipAtPoint(clipGameOver, Camera.main.transform.position); } else { gui.SetScore(currentScore, playerLife); playerHurted = true; GotoTransition(); AudioSource.PlayClipAtPoint(clipCollision, Camera.main.transform.position); } } break; } case GameState.Chilling: { collectible.Splash(); Shader.SetGlobalVector("_SplashPosition", collectible.position); break; } } }
public BonusRef(ElementId parent, Bonus bonues) { Parent = parent; Bonues = bonues; }
public void Update(GameTime gameTime) { world.Step((float)gameTime.ElapsedGameTime.TotalSeconds, 10, 10); if (world.ContactCount > 0) { for (ContactEdge ce = ship.GetContactList(); ce != null; ce = ce.Next) { bool otherHasExceeded = false; foreach (Asteroid a in asteroids) { if (a.VelocityExceeded && !a.IsBodyDestroyed) { otherHasExceeded = true; } } if (ce.Other.GetUserData() is Asteroid) { ((Asteroid)ce.Other.GetUserData()).Destroy("Ship" + (otherHasExceeded ? "2" : "")); } } for (Contact c = world.GetContactList(); c != null; c = c.GetNext()) { Body a = c.GetFixtureA().GetBody(), b = c.GetFixtureB().GetBody(); if (a.GetUserData() is Asteroid && b.GetUserData() is Asteroid) { if (((Asteroid)a.GetUserData()).VelocityExceeded) { ((Asteroid)b.GetUserData()).Destroy("Other"); } else if (((Asteroid)b.GetUserData()).VelocityExceeded) { ((Asteroid)a.GetUserData()).Destroy("Other"); } } } } List <Asteroid> toRemove = new List <Asteroid>(); foreach (Asteroid a in asteroids) { Bonus bonus = a.GetBonus(); if (bonus != Bonus.None) { bonuses.Add(bonus); Score += a.Score * (int)bonus; fuel = Math.Min(fuel + a.Score * (int)bonus * 0.0015f, MaxFuel); } if (a.body.Position.Y - ship.Position.Y > BackClearance) { a.NotVisible(); } if (a.IsNotVisible) { toRemove.Add(a); } } foreach (Asteroid a in toRemove) { asteroids.Remove(a); } if (fuel <= 0 && ship.GetLinearVelocity().Length() < 1f) { IsLevelUp = true; } float movement = ship.Position.Y - (cameraPosY + FrontClearance); cameraPosY = cameraPosY + movement; cameraPosY = MathHelper.Clamp (cameraPosY, 0, TileHeight * Height - 600); if (cameraPosY == 0) { ship.Position = new Vector2(ship.Position.X, originalShipPos.Y); asteroidsCount += 2; LoadAsteroidField((int)Math.Floor(asteroidsCount)); } }
public void PurchaseBonus(Bonus pickedBonus) { engine.PurchaseBonus(pickedBonus); }
public ActionResult Index() { Bonus bonus = new Bonus(); var usermanager = IdentityTools.NewUserManager(); //aktif kullanici ApplicationUser appuser = usermanager.FindByName(User.Identity.Name); //aktif kullanıcının hareketler var kullanici = repoUserTrans.Get(x => x.UserId == appuser.Id); //aktip kullanıcının toplam bakiyesi decimal totalb = repoUserTrans.TotalBalance(kullanici.UserId); appuser.Counter++; usermanager.Update(appuser); if (appuser.Counter - 1 == 0) { var basiccontest = repoCon.GetAll(x => x.Level == 1); var bc = basiccontest.OrderByDescending(x => x.Date).Take(1).FirstOrDefault(); List <ContestDetails> basic = repoConDeta.GetAll(x => x.ContestId == bc.Id).ToList(); if (totalb < bc.Price) { ViewBag.Message = "Bu yarışmaya katılmak için yeterli Bill yok, hesabım kısmından yükleme yapabilirsiniz"; return(Redirect("/Home/Index")); } else { UserTrans trans = new UserTrans(); trans.UserId = appuser.Id; trans.ContestId = bc.Id; trans.Prize = 0; trans.Loose = bc.Price; trans.Balance = totalb - bc.Price; repoUserTrans.Add(trans); } //şuanda yarışmadaki bütün sorular burda -->cd for (int i = 0; i < basic.Capacity; i++) { return(View(basic[i])); } } //başlama tarihi şuan olan yarışma var conlist = repoCon.GetAll(x => x.IsDeleted == false && x.Date > DateTime.Now); //bütün yarışmaları tarihe göre sıralayıp en yakını aldım var cont = conlist.OrderBy(x => x.Date).Take(1).FirstOrDefault(); //başlayacak olan yarışmanın soruları List <ContestDetails> cd = repoConDeta.GetAll(k => k.ContestId == cont.Id).ToList(); if (totalb < cont.Price) { ViewBag.Bakiye = "Bu yarışmaya katılmak için yeterli Bill yok, hesabım kısmından yükleme yapabilirsiniz"; return(Redirect("/Home/Index")); } else { UserTrans trans = new UserTrans(); trans.UserId = appuser.Id; trans.ContestId = cont.Id; trans.Prize = 0; trans.Loose = cont.Price; trans.Balance = totalb - cont.Price; repoUserTrans.Add(trans); } var bonuslist = repoBonus.GetAll(x => x.UserId == appuser.Id && x.IsDeleted == false); if (bonuslist != null) { foreach (var item in bonuslist) { if (item.WheelValueId == 17 || item.WheelValueId == 10) { ViewBag.Saniye = "+"; } } } //şuanda yarışmadaki bütün sorular burda -->cd for (int i = 0; i < cd.Capacity; i++) { return(View(cd[i])); } return(View(cd)); }
private void DestroyedBonus(Bonus bonus) { bonus.Collected -= CollectedBonus; bonus.Destroyed -= DestroyedBonus; bonusesPool.ReturnObject(bonus.gameObject); }
/// <summary> /// /// </summary> /// <param name="bonus"></param> public void AddServiceBonus(Bonus bonus) { _context.Bonus.Add(bonus); }
public Frame() { Bonus = new Bonus(); }
private static void BonusTask(VaporStoreDbContext context) { string bonusOutput = Bonus.UpdateEmail(context, "atobin", "*****@*****.**"); Console.WriteLine(bonusOutput); }
private void SpawnBonus() { BonusSpawned = true; bonus = GameWorld.Instance.SpawnBonus(GameWorld.Instance.WorldCoordinates(GameWorld.Instance.GetRandomOpenSpot())); bonus.OnCollected += OnBonusCollected; }
// Le jeu est dans l'état PLAY private void AnimatePlay() { GameRecord record; while (_cfg.play.Count > 0) { record = _cfg.play[0]; if (record.tim > oturn) { break; } _cfg.play.RemoveAt(0); _cfg.playerCfg.record.Add(record); if (record.tim == oturn) { if (record.isKey) { switch (record.key) { case PacmanKey.Back: { TXYList xyList = _Pacman.xyList; if (!xyList.empty) { xyList.deAdd(); } } break; case PacmanKey.Left: _Pacman.Left(); break; case PacmanKey.Right: _Pacman.Right(); break; case PacmanKey.Down: _Pacman.Down(); break; case PacmanKey.Up: _Pacman.Up(); break; } } else { intProcessKey(record.tsk); } } } if (Labyrinth.getCurrent().RemainingPills <= 0) { // toutes les pastilles ont été mangées, changement de niveau // accélère un peu le jeu Level++; SleepTime -= 1; numLaby = (numLaby + 1) % 4; SetLabyrinth(numLaby); SetMode(GameMode.READY); } else { int i; int xp, yp; GhostState state; EraseSprites(); ErasePoints(); // testes de collisions xp = _Pacman.X; yp = _Pacman.Y; // collisions avec les fantomes foreach (Ghost ghost in _Ghosts) { state = ghost.State; // teste si le Pacman est en collision avec le Fantome i if (_Pacman.HasCollision(ghost)) { if (state.isHunt() || state.isRandom()) { // Perdu une vie SetMode(GameMode.DEATH); return; } else if (state.isFlee()) { // le fantome est mangé ghost.setState(GhostState.EYE); AddScore(_GhostScore); FantScore *= 2; AddPoints(_GhostScore); if (Audio != null) { Audio.PlayEatGhost(); } } } } // collisions avec le bonus if (CurrentBonus != null) { // le bonus existe if (_Pacman.HasCollision(CurrentBonus)) { int points = Math.Min(1600, Level * 100); AddScore(points); AddPoints(points); CurrentBonus = null; if (Audio != null) { Audio.PlayBonus(); } } if (CurrentBonus != null && CurrentBonus.animate() <= 0) { // le bonus est en fin de vie CurrentBonus = null; } } else { // pas de bonus if (Game.GetRandom(1000) < 5) { CurrentBonus = new Bonus(Level - 1); } } // animate pacman if (speedCheck(Config.SpeedPacman)) { i = _Pacman.animate(); if (i == 1) { // une pastille est mangée AddScore(10); Audio.PlayPill(); } else if (i == 2) { FantScore = 100; // Les fantomes qui chasse deviennent fuyards AddScore(50); Audio.PlayBigPill(); setGhostsState(GhostState.FLEE); } } // animate fantomes // bool siren = false; foreach (Ghost ghost in _Ghosts) { switch (ghost.State.ToEnum()) { case GhostStateEnum.FLEE: ghost.speedDevider = Config.GhostSpeedFlee; break; case GhostStateEnum.EYE: ghost.speedDevider = Config.GhostSpeedEye; break; default: if (Math.Sqrt((_Pacman.xLaby - ghost.xLaby) ^ 2 + (_Pacman.yLaby - ghost.yLaby) ^ 2) < Config.SafeRadius) { if (ghost.State.isHunt()) { if (GetRandom(Config.GhostSpeedSwitchTime) == 2) { if (GetRandom(1) == 1) { ghost.speedDevider = Config.GhostSpeedHunt; } else { ghost.speedDevider = Config.GhostSpeedHuntPulse; } } } else { ghost.speedDevider = Config.GhostSpeed; } } else { ghost.speedDevider = Config.GhostSpeedOutSafe; } break; } if (!speedCheck(ghost.speedDevider)) { ghost.timers(); continue; } ghost.setPacmanCoor(xp, yp); ghost.animate(); // if (!siren && ghosts[i].getState().isHunt()) { // siren = true; // Audio.playSiren(); // } } // animate points foreach (FlyingScore pt in _FlyingScores) { pt.animate(); } DrawSprites(); DrawPoints(); DrawScore(); DrawLives(); //if (DEBUG) //{ // foreach(Ghost ghost in _Ghosts) // { // //draw.drawDebugString(4, 12 + i * 12, 12, ghosts[i].toString()); // } //} } }
public static int GetAmount(Bonus item) { return(PlayerPrefs.GetInt(item.ToString())); }
private void btn_KitapEkeBilgi_Click(object sender, RoutedEventArgs e) { Bonus.PopupShow(popup_bilgi); }