private void button1_Click(object sender, EventArgs e) { try { db = new giedaEntities(); var myPhase = new phase() { name = name.Text, title = title.Text, description = description.Text, created_at = DateTime.Now, updated_at = DateTime.Now }; db.phases.Add(myPhase); db.SaveChanges(); MessageBox.Show("Record Added Successfully"); this.Close(); } catch (Exception ex) { MessageBox.Show("Error !! " + ex.Message); } }
void BlockBuild(phase p) { switch (p) { case phase.phase1: StartCoroutine(blockbulider(0, 10, 2)); break; case phase.phase2: StartCoroutine(blockbulider(10, 150, 3)); break; case phase.phase3: StartCoroutine(blockbulider(150, 300, 3.5f)); break; case phase.phase4: StartCoroutine(blockbulider(300, 500, 3.5f)); break; case phase.phase5: StartCoroutine(blockbulider(500, 800, 4)); break; case phase.phase6: StartCoroutine(blockbulider(800, 1000, 4)); break; case phase.phase7: StartCoroutine(blockbulider(1000, 2000, 4)); break; } }
public void letsBattle() { if (currentPhase == phase.player) { currentPhase = phase.battle; } }
public IHttpActionResult Putphase(int id, phase phase) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != phase.ID) { return(BadRequest()); } db.Entry(phase).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!phaseExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
// Start is called before the first frame update void Start() { deck = new List <int>(GameObject.Find("Deck").GetComponent <deck>().decklist); shuffle(deck); addBossUniqueCard(); bossdeck = new List <int>(GameObject.Find("Deck").GetComponent <deck>().bossDecklist); shuffle(bossdeck); handlist = new List <int>(); grave = new List <int>(); bossgrave = new List <int>(); bossfield = new List <int>(); field = new List <int>(); Carddata = new carddata(); LoadCardDataFromjson(GameObject.Find("Deck").GetComponent <whoandwhere>().number); Board = new board(); handlimit = 5; currentPhase = phase.start; currentHand = 0; currentBossField = 0; currentField = 0; enemyFieldLimit = GameObject.Find("Deck").GetComponent <whoandwhere>().thefloor + 1; enemyField = 0; how_many_boss_right = 0; how_many_my_right = 0; CharactersName(); attacker = -1; }
// Update is called once per frame void Update() { if (state == phase.Active) { rdm = Random.Range(0, 3); ennemy[rdm].SetActive(false); Debug.Log(rdm); state = phase.Moving; } else if (state == phase.Moving) { for (int i = 0; i < ennemy.Count; i++) { ennemy[i].GetComponent <MovingEnnemyTeamVague>().Moving(); } } else if (state == phase.Replace) { for (int j = 0; j < ennemy.Count; j++) { ennemy[j].transform.position = new Vector3(pos.position.x, ennemy[j].transform.position.y, ennemy[j].transform.position.z); ennemy[j].SetActive(true); } state = phase.Active; } }
public IEnumerator HeroAttackPhase() { turnPhase = phase.CombatPhase; //sets state of combat phase for (int i = 0; i < equippedCreaturesObj.Count; i++) //loop repeats for each creature fighting the hero { CreatureCard attackCreature = equippedCreaturesObj[i].GetComponent <CreatureCard>(); StartCoroutine(animationController.AttackMove(equippedCreaturesObj[i], equippedHeroObj[0])); //starts coroutine for moving attacking card attackCreature.PlaySound(); //plays sound effect if (attackCreature.creatureData.dmg > currentArmour.armourData.hp) //checks if creature attack is strong enough to pierce armour { defHero.heroData.hp -= attackCreature.creatureData.dmg - currentArmour.armourData.hp; //creature deals damage } HeroHPUpdate(); //updates UI text float combatDelay = 1.3f; yield return(new WaitForSeconds(combatDelay)); //if (i!=equippedCreaturesObj.Count-1) //{ // yield return new WaitForSeconds(combatDelay); //} //else if (i == equippedCreaturesObj.Count - 1) //{ // yield return null; //} } if (defHero.heroData.hp <= 0) //checks if hero is dead { GameOver(); CancelInvoke(); } Invoke("EndTurn", endTurnDelay); }
private void SetChase() { ps = phase.chase; if (count < 4) { Invoke("SetScatter", chase_time); } }
public void letsPlayer() { if (currentPhase == phase.draw) { currentPhase = phase.player; StartCoroutine("enemyReady"); } }
public void letsStart() { if (currentPhase == phase.end) { currentPhase = phase.start; recover(); } }
public void letsDraw() { if (currentPhase == phase.start) { currentPhase = phase.draw; StartCoroutine("drawit"); } }
public void letsEnd() { if (currentPhase == phase.battle) { enemyDone = false; StartCoroutine("EnemyAttackTime"); currentPhase = phase.end; } }
private void SetScatter() { count++; if (count > 3) { scatter_time = 5; } Invoke("SetChase", scatter_time); ps = phase.scatter; }
IEnumerator EnemyAttackTime() { while (enemyDone == false) { enemyAttack(); yield return(new WaitForSeconds(1f)); } currentPhase = phase.start; recover(); }
public IHttpActionResult Getphase(int id) { phase phase = db.phases.Find(id); if (phase == null) { return(NotFound()); } return(Ok(phase)); }
private void Start() { ps = phase.leave; Invoke("SetScatter", 1.5f); dot_threshold_one = dot_num / 3 * 2; dot_threshold_two = dot_num / 3; rd = red.GetComponent <SpriteRenderer>().sprite; or = orange.GetComponent <SpriteRenderer>().sprite; pi = pink.GetComponent <SpriteRenderer>().sprite; p = purple.GetComponent <SpriteRenderer>().sprite; }
public GameData() { phaseOfGame = phase.waiting; players = new List<string>(); playersAndColors = new List<PlayerList.Player>(); playersAndCoords = new List<VisiblePlayers.Player>(); //mapObjects = new List<List<VisibleObjects.MapObject>>(); rand = new Random(); timeOfEndingPhaseWaiting = DateTime.Now.AddSeconds(30); timeOfEndingPhaseGame = DateTime.Now.AddSeconds(50); timeOfEndingPhaseResult = DateTime.Now.AddSeconds(60); }
public IHttpActionResult Postphase(phase phase) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.phases.Add(phase); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = phase.ID }, phase)); }
public GameData() { phaseOfGame = phase.waiting; players = new List <string>(); playersAndColors = new List <PlayerList.Player>(); playersAndCoords = new List <VisiblePlayers.Player>(); //mapObjects = new List<List<VisibleObjects.MapObject>>(); rand = new Random(); timeOfEndingPhaseWaiting = DateTime.Now.AddSeconds(30); timeOfEndingPhaseGame = DateTime.Now.AddSeconds(50); timeOfEndingPhaseResult = DateTime.Now.AddSeconds(60); }
//calls the event for stopping the touch private void fingerReleased() { inputPhase = phase.idle; data.state = fingerState.up; //this is temporary and will not work on android data.lastX = Input.mousePosition.x; if (onFingerUp != null) { onFingerUp(); } }
//calls the event for first touching the screen private void fingerTapped() { inputPhase = phase.started; data.state = fingerState.down; //this is temporary and will not work on android data.startX = Input.mousePosition.x; if (onFingerDown != null) { onFingerDown(); } }
public IHttpActionResult Deletephase(int id) { phase phase = db.phases.Find(id); if (phase == null) { return(NotFound()); } db.phases.Remove(phase); db.SaveChanges(); return(Ok(phase)); }
public GameData() { namesOfFileLabyrinths = new List <string>(); namesOfFileLabyrinths.Add("labyrinth1.txt"); players = new Dictionary <string, Player>(); playersAndCoords = new List <VisiblePlayers.Player>(); mapObjects = new List <VisibleObjects.MapObject>(); rand = new Random(); timeOfEndingPhaseWaiting = DateTime.Now.AddSeconds(40); timeOfEndingPhaseGame = DateTime.Now.AddSeconds(50); timeOfEndingPhaseResult = DateTime.Now.AddSeconds(60); ReadLabyrinth("labyrinth1.txt"); phaseOfGame = phase.waiting; }
public IActionResult Post([FromBody] phase value) { var phase = new phase(); phase.phaseId = value.phaseId; phase.name = value.name; phase.isActive = true; _context.phase.Add(phase); _context.SaveChanges(); var send = _context.phase.Where(c => c.phaseId == phase.phaseId).FirstOrDefault <phase>(); return(Ok(send)); }
private void StopRun() { red.GetComponent <SpriteRenderer>().sprite = rd; orange.GetComponent <SpriteRenderer>().sprite = or; pink.GetComponent <SpriteRenderer>().sprite = pi; purple.GetComponent <SpriteRenderer>().sprite = p; ps = prev_phase; if (ps == phase.scatter) { Invoke("SetChase", scatter_time); } else { Invoke("SetScatter", chase_time); } }
public void ChangePhase() { switch (currentPhase) { case phase.empty: ImagesToHide.AddRange( new List <Image>() { normalMeat, burnedMeat } ); ImagesToShow.Add(rawMeat); timer.Set(GameData.FRY_TIME, ChangePhase, counter); currentPhase = phase.raw; break; case phase.raw: ImagesToHide.AddRange( new List <Image>() { rawMeat, burnedMeat } ); ImagesToShow.Add(normalMeat); timer.Set(GameData.BURN_TIME, ChangePhase, counter); counter.ChangeColor(); currentPhase = phase.normal; break; case phase.normal: ImagesToHide.AddRange( new List <Image>() { rawMeat, normalMeat } ); ImagesToShow.Add(burnedMeat); timer.Reset(); currentPhase = phase.burned; break; } UpdateView(); }
public IActionResult deactivate(int id, [FromBody] phase value) { var phase = _context.phase.Where(c => c.phaseId == id).FirstOrDefault <phase>(); if (phase != null) { phase.isActive = false; _context.SaveChanges(); return(Ok(phase)); } else { return(NotFound()); } }
// Update is called once per frame new void Update() { base.Update(); switch (currPhase) { case phase.exit: // missile has just been launched and is delayed before targeting transform.position += transform.up * launchSpeed * Time.deltaTime; duration -= Time.deltaTime * 1000; if (duration <= 0) { currPhase = phase.lockOn; } break; case phase.lockOn: //find a target GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy"); if (enemies.Length == 0) { break; } lockTarget = enemies[Random.Range(0, enemies.Length)]; if (lockTarget != null) { currPhase = phase.attacking; } break; case phase.attacking: //rotate and move toward target if (lockTarget == null) { currPhase = phase.lockOn; break; } rotateToward(lockTarget); transform.position += transform.up * speed * Time.deltaTime; break; } }
//イベントから呼ばれた機能、numによってphaseが変わる public void healtISLess(int num) { if (num == 2) { currentState = State.Attackc; currentphase = phase.phase2; } else if (num == 3) { currentState = State.Attackd; currentphase = phase.phase3; } else if (num == 4) { currentphase = phase.end; anim.SetTrigger("dead"); } }
public void RemoveMeat() { ImagesToHide.AddRange( new List <Image>() { rawMeat, normalMeat, burnedMeat } ); UpdateView(); timer.Reset(); if (counter.currentColor != TimerView.color.green) { counter.ChangeColor(); } currentPhase = phase.empty; }
public IActionResult Put(int id, [FromBody] phase value) { var phase = _context.phase.Where(c => c.phaseId == id).FirstOrDefault <phase>(); if (phase != null) { phase.name = value.name; _context.SaveChanges(); var send = _context.phase.Where(c => c.phaseId == phase.phaseId).FirstOrDefault <phase>(); return(Ok(send)); } else { return(NotFound()); } }
private void Charge(Game1 game, GameTime gameTime) { Game1.character.targetSpeed = 5.5f; GoTo(new Vector2((Game1.character.positionRectangle.X + (Game1.character.positionRectangle.Width / 2)) / Game1.map.tileWidth, (Game1.character.positionRectangle.Y + (Game1.character.positionRectangle.Height / 2)) / Game1.map.tileHeight), false, gameTime); if (position.Intersects(Game1.character.attackRectangle) && healthPct > 0) { damage = game.damageObject.dealDamage(10, 27); damageEffectList.Add(new DamageEffect(damage, game, new Vector2(Game1.character.positionRectangle.X, Game1.character.positionRectangle.Y), new Color(235, 10, 10, 255), "npc")); Game1.character.health -= damage; if (Game1.character.health <= 0) { Respawn(game); } Game1.character.Hit(); phaseTimer = 0; currentPhase = phase.beam; } if (!enraged) { if (phaseTimer >= 5) { phaseTimer = 0; currentPhase = phase.beam; } } else { if (phaseTimer >= 2.5f) { phaseTimer = 0; currentPhase = phase.beam; } } }
private void SwitchPhase() { if (currentPhase == phase.beam && phaseTimer != 0) { currentPhase = phase.mobs; phaseTimer = 0; } if (currentPhase == phase.mobs && phaseTimer != 0) { currentPhase = phase.charge; phaseTimer = 0; } if ((currentPhase == phase.sleep)) { sleepTimer = SLEEPTIMER; currentPhase = phase.beam; } }
public void FinishGame() { phaseOfGame = phase.result; }
public void StartGame() { phaseOfGame = phase.game; }
private void SpawnMobs(Game1 game) { if (healthPct > 0 && mobs.Count < 50) { for (int i = 0; i < 5; i++) { mobs.Add(new Npc(position.X + i, position.Y - 48 + i, 30, 25, game.Content.Load<Texture2D>(@"Npc\bot"), game, map, 1, true, 25, 1, 5, 1, true)); } for (int i = 0; i < mobs.Count; i++) { mobs[i].mob = true; mobs[i].bossMob = true; mobs[i].position.Width = 30; mobs[i].position.Height = 25; currentPhase = phase.charge; } } }