public override void OnEndTurn(Fighter fighter) { if (fighter.CurrentMP > 0) { this.ChallengeFailed(fighter); } }
protected void sorcererStart(){ //important that this happens first, other initializations depend on it fighter = (Fighter) GameObject.FindObjectOfType (typeof (Fighter)); //logically the sorcerer shouldn't be an enabled player unless it's the client in a game playerEnabled = false; if (Network.isClient) { playerEnabled = true; fighter.playerEnabled = false; } //inititalize skills before Player start activeSkill1 = null; activeSkill2 = null; activeSkill3 = null; activeSkill4 = null; activeSkill5 = null; activeSkill6 = null; playerStart (); initializePlayer(); initializeLevel(); initializePrimaryStats(); initializeSecondaryStatsBase(); initializeSecondaryStats(); calculateSecondaryStats(); health = maxHealth; fighter.energy = fighter.maxEnergy; target = null; startPosition = transform.position; //networking: sorcererNetworkScript = (SorcererNetworkScript)gameObject.GetComponent<SorcererNetworkScript> (); //database.readPrimaryStats(); }
public static Player Add(Fighter player) { if (Players == null) { Players = new Fighter[4]; isFull = false; numPlayers = 0; } for (int i = 0; i < Players.Length; i++) { if (Players [i] == null) { Players [i] = player; numPlayers++; UpdateContainer (); switch (i) { case 0: Player1 = player; return Player.Player1; case 1: Player2 = player; return Player.Player2; case 2: Player3 = player; return Player.Player3; case 3: Player4 = player; return Player.Player4; default: Player1 = player; return Player.Player1; } } } return Player.Null; }
public override void SetUp() { Params.Load("default.properties"); List<Entity> children = XNAGame.Instance.Children; Fighter leader = new Fighter(); leader.Position = new Vector3(10, 120, 20); leader.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.wander); leader.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.obstacle_avoidance); leader.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.wall_avoidance); children.Add(leader); Fighter camFighter = new Fighter(); camFighter.Leader = leader; camFighter.Position = new Vector3(10, 120, 0); camFighter.offset = new Vector3(0, 5, 10); camFighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.offset_pursuit); camFighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.wall_avoidance); camFighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.obstacle_avoidance); XNAGame.Instance.CamFighter = camFighter; children.Add(camFighter); Ground ground = new Ground(); children.Add(ground); XNAGame.Instance.Ground = ground; XNAGame.Instance.Camera.Position = new Vector3(10, 120, 50); foreach (Entity child in children) { child.LoadContent(); } }
private IEnumerator DoSpawn(float delay, Action callback, Transform targetTransform) { yield return new WaitForSeconds(delay); if (!_hasSpawned) { _fighterInst = Instantiate<Fighter>(FighterPrefab); _fighterInst.SpawnVehicle(_fighterInst.gameObject, _fighterInst.VehiclePrefab, Universe.Current.GetUniversePosition(transform.position), transform.rotation); if (targetTransform != null) _fighterInst.SetTarget(targetTransform); if (AddWarpEffect) { _warpEffect = _fighterInst.VehicleInstance.gameObject.AddComponent<WarpEffect>(); _warpEffect.transform.position = transform.position; _warpEffect.transform.forward = transform.forward; _warpEffect.WarpEffectPrefab = SpawnEffect; _warpEffect.Timeout = 0.4f; _warpEffect.Distance = 20f; } _hasSpawned = true; if (callback != null) callback(); if (OnSpawn != null) OnSpawn(_fighterInst.gameObject); } }
public static bool Remove(Player player) { if (player == Player.Null) { return false; } switch (player) { case Player.Player1: Player1 = null; Players [0] = null; break; case Player.Player2: Player2 = null; Players [1] = null; break; case Player.Player3: Player3 = null; Players [2] = null; break; case Player.Player4: Player4 = null; Players [3] = null; break; } numPlayers--; UpdateContainer (); return true; }
public virtual void BeginAttack(Damage damageToDeal, Fighter attacker) { weaponUser = attacker; attackCast.OnHit += OnWeaponHit; damageOut = damageToDeal; attackCast.Begin (); }
public virtual bool Fire(Fighter plr, SPoint o, SPoint v) { plNum = plr.plNum; vel = new SPoint (velx*v.x, vely); float diff; if (!plr.fHelper.IsFacingRight()) { diff = ((Mathf.PI / 2) - dir) * 2.0f; dir += diff; } //dir 2.0fis the vector to travel in per second //if(active) // return false; active=true; pos=new SPoint(o.x,o.y+16); transform.position = new Vector3 (pos.x, pos.y, 0); ttl.SetTimer(2); for (int i=0; i<ps.Length; i++) { if (ps != null) { ps[i].transform.position = new Vector3 (pos.x, pos.y, 0); ps[i].enableEmission = true; ps[i].Play (); } } return true; }
// Use this for initialization void Start () { subscribeToSorcererInstancePublisher (); // jump into game fighter = (Fighter) GameObject.FindObjectOfType (typeof (Fighter)); sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer = (Sorcerer) GameObject.FindObjectOfType (typeof (Sorcerer)); }
// Update is called once per frame void FixedUpdate() { if(mainCamera == null || fighter == null || sorcerer == null){ mainCamera = GameObject.FindGameObjectWithTag("MainCamera") as GameObject;; fighter = GameObject.FindObjectOfType(typeof(Fighter))as Fighter; sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer= GameObject.FindObjectOfType (typeof (Sorcerer))as Sorcerer; } else{ Player player = (fighter.playerEnabled)? (Player) fighter : sorcerer; float distance = Vector3.Distance(mainCamera.transform.position,player.transform.position); RaycastHit[] hits = Physics.RaycastAll (mainCamera.transform.position, player.transform.position, distance,checkLayers); foreach (GameObject gO in invisibleList){ gO.layer = LayerMask.NameToLayer(visibleLayerName); } invisibleList = new List<GameObject>(); foreach(RaycastHit hit in hits){ if(Vector3.Distance (mainCamera.transform.position,hit.collider.gameObject.transform.position)<distance){ hit.collider.gameObject.layer = LayerMask.NameToLayer(invisibleLayerName); invisibleList.Add(hit.collider.gameObject); } } // foreach(GameObject gO in gameObjects){ // if (gO == this.gameObject){ // this.gameObject.layer = invisibleLayer.value; // } // else{ // this.gameObject.layer = visibleLayer.value; // } // } } }
void OnGotHit(Fighter attacker) { Alive attackersAlive = attacker.GetComponent<Alive>(); if (!charController.CommandIssued && !attackersAlive.IsDead) { charController.Command_Attack( attackersAlive ); } }
// Use this for initialization void Start () { player = (Fighter) GameObject.FindObjectOfType (typeof (Fighter)); healthFrameWidth = (float)Screen.width*healthFrameWidthFix; healthFrameHeight = (float)Screen.height*healthFrameHeightFix; healthFillWidth = (float)Screen.width*healthFillWidthFix; healthFillHeight =(float)Screen.height*healthFillHeightFix; }
public override void SetUp() { Params.Load("default.properties"); List<Entity> children = XNAGame.Instance.Children; Ground ground = new Ground(); children.Add(ground); XNAGame.Instance.Ground = ground; Fighter fighter = new Fighter(); fighter.ModelName = "cobramk1"; fighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.arrive); fighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.obstacle_avoidance); fighter.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.wall_avoidance); fighter.Position = new Vector3(2, 20, -50); fighter.TargetPos = fighter.Position * 2; XNAGame.Instance.Leader = fighter; children.Add(fighter); Fighter fighter1 = new Fighter(); fighter1.ModelName = "viper"; fighter1.Target = fighter; fighter1.SteeringBehaviours.turnOn(SteeringBehaviours.behaviour_type.pursuit); fighter1.Position = new Vector3(-20, 20, -20); children.Add(fighter1); foreach (Entity child in children) { child.LoadContent(); } }
public void AttackDetect(Fighter plr) { //projectile checks SPoint[] pHdr = new SPoint[8]; SPoint[] plBox; plBox = plr.GetHitBox(); int hbLen=4; float[] plAng ={0, Mathf.PI/2, Mathf.PI, -Mathf.PI/2}; bool hitflag = true; for (int i=0; i<8; i++) pHdr [i] = new SPoint (v [i].x + pos.x, v [i].y +pos.y); float atkLen = GetVNum (); for (int j = 0; j < atkLen; j++) if (!CheckAxis (pHdr [0], ang [j], plBox, pHdr, hbLen, GetVNum ())) //no axis intersection hitflag = false; if (hitflag)//test on the axis of the player hit box to confirm for (int j = 0; j < 4; j++) if (!CheckAxis (plBox [j], plAng [j], plBox, pHdr, hbLen,GetVNum ())) //no axis intersection hitflag = false; if (hitflag) { active = false; plr.GetHit (hitdata); Detonate (); } }
public override void Execute(Fighter fighterRef, PlayerCombatScript combatScript) { fighterRef.GetComponent<Animator>().SetTrigger(_jumpHash); Vector2 v = gameObject.GetComponent<Rigidbody2D>().velocity; v.y = _jumpSpeed; fighterRef.gameObject.GetComponent<Rigidbody2D>().velocity = v; }
public override void OnMove(Fighter fighter, int value) { if (value > 1) { this.ChallengeFailed(fighter); } }
// Use this for initialization void Start () { fighter = GameObject.FindObjectOfType<Fighter> (); sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); idealRatio = maxHeight / maxDistance; height = maxHeight; distance = maxDistance; angle = 45f; }
public void AddFighter(Fighter fighter) { m_fighters.Add(fighter); fighter.Fight = Fight; fighter.OnAdded(); Fight.UpdateTeam(this); fighter.ShowFighter(); // ????? }
public static void Detonate(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid) { var bomb = fighter.Fight.GetFighter(castcellid) as BombFighter; if (bomb != null) { bomb.Detonate(); } }
void resetGame () { //Remove player fighter playerFighter = null; //Remove enemies EnemyHandler.enemies = new List<Fighter>(); running = false; }
public IFighter ManufactureFighter(string name, double attackPoints, double defensePoints, bool stealthMode) { IsNameInUse(name); Fighter fighter = new Fighter(name, attackPoints, defensePoints, stealthMode); machines.Add(fighter); return fighter; }
public static void MultiplyTakenDamages(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid) { foreach (var target in affecteds) { MultiplyTakenDamageBuff buff = new MultiplyTakenDamageBuff((uint)target.BuffIdProvider.Pop(), effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay); target.AddBuff(buff); } }
// Use this for initialization void Start() { player = GetComponent<Round>().Players [0].GetComponent<Fighter> (); GameObject.Find ("HealthBar1").GetComponentInChildren<TextMesh> ().text = GetComponent<Round>().Players [0].GetComponent<Fighter>().charType; GetComponent<Round>().maxPlayers = 2; player.stars = GameManager.roundNum; NewWave (); }
public static void AddState(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castercellid) { foreach (var target in affecteds) { StateBuff buff = new StateBuff((uint)target.BuffIdProvider.Pop(), (short)effect.BaseEffect.Value, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.Delay); target.AddBuff(buff); } }
public static void AddRange(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affecteds, short castcellid) { foreach (var target in affecteds) { var definition = new UInt16ReflectedStat(StatsRecord.GetFieldInfo("_Range"), target.FighterStats.Stats); target.AddBuff(new StatBuff((uint)target.BuffIdProvider.Pop(), definition, (uint)effect.BaseEffect.EffectType, effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.DiceNum, effect.BaseEffect.Delay)); } }
public static void AddVitality(Fighter fighter, SpellLevelRecord level, ExtendedSpellEffect effect, List<Fighter> affected, short castcellid) { foreach (var target in affected) { var definition = new UInt16ReflectedStat(StatsRecord.GetFieldInfo("LifePoints"), target.FighterStats.Stats); target.AddBuff(new StatBuff((uint)target.BuffIdProvider.Pop(), definition, (uint)ActionsEnum.ACTION_CHARACTER_BOOST_VITALITY, effect.BaseEffect.DiceNum, effect.BaseEffect.Duration, fighter.ContextualId, (short)level.SpellId, effect.BaseEffect.DiceNum, effect.BaseEffect.Delay)); } }
//Initialization of variables void Start () { player = (Fighter) GameObject.FindObjectOfType (typeof (Fighter)); hp = player.health; maxhp = player.maxHealth; healthPercent = 1; initialGlobeSize = globeSize; initialGlobeHeight = globeHeight; }
// Use this for initialization void Start () { Debug.Log ("Am i second?"); fighter = (Fighter)GameObject.FindObjectOfType (typeof (Fighter)); sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); fighter.transform.position = initialFighterPosition; sorcerer.transform.position = initialSorcererPosition; checkSorcererPosition(); }
// Update is called once per frame void Update() { player = GameObject.FindGameObjectWithTag("Player").GetComponent<Fighter>(); healthBar.fillAmount = Mathf.Lerp (healthBar.fillAmount, (float)player.PlayerClass.health / (float)player.PlayerClass.maxHealth, 0.05f); healthNumbers.GetComponent<Text>().text = player.PlayerClass.health.ToString() + "/" + player.PlayerClass.maxHealth.ToString(); }
//Initialization of variables void Start (){ player = (Fighter) GameObject.FindObjectOfType (typeof (Fighter)); energyPercent = 1; energy = player.energy; maxEnergy = player.maxEnergy; initialGlobeSize = globeSize; initialGlobeHeight = globeHeight; }
public Erosion(Fighter source, SpellLevelRecord level, EffectInstance effect, Fighter[] targets, MapPoint castPoint, bool critical) : base(source, level, effect, targets, castPoint, critical) { }
public Shoot(Fighter user, double speedcost, double strength) : base(user, speedcost) { Name = "Flintlock Shot"; AdditionalReceiverEffects.Add(new QuickProjectile(strength)); }
/// <summary> /// Ajoute au royalmouth les points de mouvement apres avoir été poussé /// </summary> private void RegainMpOnSlided() { Fighter.RegainMp(Fighter.Id, MpBuffAmount); }
private int ScorePush(AIProcessor AI, Fighter Target, int Direction, int Length, bool Fear) { bool isAlly = Target.Team == AI.myFighter.Team; List <Fighter> TargetList = new List <Fighter>() { Target }; var LastCell = Target.Cell; int Score = 0; foreach (var Layer in Target.Cell.GetObjects <FightGroundLayer>())//On cherche à savoir si décaller de cette cellule est utile { int LayerScore = 0; foreach (var Effect in Layer.CastSpell.Effects) { LayerScore = (int)Math.Floor(AIAction.AIActions[AIActionEnum.SELF_ACTING].GetEffectScore(AI, -1, -1, Effect, TargetList, true, true)); } if (Layer is FightBlypheLayer) { LayerScore *= 2; } Score += LayerScore; } int PathScore = 4; int FinalLength = 0; for (int i = 0; i < Length; i++) { var NextCell = Target.Fight.GetCell(Pathfinder.NextCell(Target.Fight.Map, LastCell.Id, Direction)); if (NextCell != null) { LastCell = NextCell; } if (NextCell != null && NextCell.IsWalkable()) { if (NextCell.HasGameObject(FightObjectType.OBJECT_FIGHTER) || NextCell.HasGameObject(FightObjectType.OBJECT_STATIC) || Target.States.HasState(FighterStateEnum.STATE_ENRACINER)) { if (!Fear) { PathScore *= EffectPush.RANDOM_PUSHDAMAGE.Next(4, 7); if (isAlly) { PathScore *= -1; } } break; } else if (NextCell.HasGameObject(FightObjectType.OBJECT_TRAP)) {//On Stop seulement : ce genre de calcul se fera a la fin. break; } } else { if (!Fear) { PathScore *= EffectPush.RANDOM_PUSHDAMAGE.Next(4, 7); if (isAlly) { PathScore *= -1; } } break; } FinalLength += 1; } Score += FinalLength * PathScore; if (LastCell != Target.Cell) { foreach (var Layer in LastCell.GetObjects <FightGroundLayer>()) { int LayerScore = 0; foreach (var Effect in Layer.CastSpell.Effects) { LayerScore += (int)Math.Floor(AIAction.AIActions[AIActionEnum.SELF_ACTING].GetEffectScore(AI, -1, -1, Effect, TargetList, false, true)); } if (Layer is FightTrapLayer) // TODO : Calculate if traplayer others targets { LayerScore *= 4; //Immediat } else if (Layer is FightBlypheLayer) { LayerScore *= 2;//Debut de tour } Score += LayerScore; } } return(Score); }
public SpellHistoryEntry(SpellHistory history, SpellLevelRecord spell, Fighter caster, Fighter target, int castRound) { this.History = history; this.Spell = spell; this.Caster = caster; this.Target = target; this.CastRound = castRound; }
public override void onLaunchSpell(Fighter Launcher, Spells.SpellLevel Spell, int TargetCellId, Fighter TargetFighter, Dictionary <Spells.EffectInfos, List <Fighter> > TargetEffects, bool IsCC, bool IsEchec) { }
public override void onLaunchWeapon(Fighter Launcher, Database.Models.InventoryItemModel Weapon, int TargetCellId, Fighter TargetFighter, Dictionary <Character.WeaponEffect, List <Fighter> > TargetEffects, bool IsCC, bool IsEchec, bool isPunch) { }
public override Profession GetNewInstance() { Fighter newFighter = new Fighter(CombatAttribute, MainAttributes); return(newFighter); }
public Berserk(Fighter user, double SpeedCost, double ManaCost, int lifespan, double strengthRatio, double healthTick) : base(user, SpeedCost) { AdditionalUserEffects.Add(new Uncontrolled(lifespan, healthTick)); AdditionalUserEffects.Add(new Enraged(lifespan, (User.Strength * strengthRatio) - User.Strength)); }
public Stun(Fighter user, double SpeedCost, double manaCost, int lifespan, double multiplier) : base(user, SpeedCost) { AdditionalReceiverEffects.Add(new Stunned(lifespan, multiplier)); }
public SpellCastHistory(Fighter fighter) { Fighter = fighter; m_readOnlyCasts = new ReadOnlyObservableCollectionMT <SpellCast>(m_casts); }
public void Hit(Fighter enemy) { enemy.hp -= damage; }
public void startFight(string n) { var player = new Fighter(n, 100, 20); displayStats(player.Name, player.Health, player.AttackPower, enemy.Name, enemy.Health, enemy.AttackPower); Console.WriteLine("\nThe fight begins!"); Console.WriteLine("\n\n Choose your move\n"); while (gameRunning) { Console.WriteLine("\na)Attack\nb)Block\nc)Charge attack power\nh)Heal\ns)Display stats\n"); char userInput = Console.ReadKey().KeyChar; switch (userInput) { case 'a': //Both attack player.attack(player.AttackPower, Enemy.aiMoveSelector(), enemy.AttackPower, enemy.Health); if (player.CurrentMove == Enemy.aiMoveSelector()) { enemy.attack(enemy.AttackPower, player.CurrentMove, player.AttackPower, player.Health); Console.WriteLine($"Your health: {player.Health}"); Console.WriteLine($"Enemy health: {enemy.Health}"); } //Player attacks, AI blocks else if (Enemy.aiMoveSelector() == player.CurrentMove + 1) { enemy.block(player.CurrentMove, player.AttackPower); Console.WriteLine($"Your attack power decresed to: {player.AttackPower}"); Console.WriteLine($"Enemy health: {enemy.Health}"); } //Player attacks, AI charges else if (Enemy.aiMoveSelector() == player.CurrentMove + 2) { enemy.chargeAttack(player.CurrentMove, player.AttackPower); Console.WriteLine($"Enemy attack power increase to: {enemy.AttackPower}"); Console.WriteLine($"Enemy health: {enemy.Health}"); } //Player attacks, AI heals else if (Enemy.aiMoveSelector() == player.CurrentMove + 3) { enemy.heal(player.CurrentMove, player.AttackPower); Console.WriteLine($"Enemy health: {enemy.Health}"); } break; case 'b': //Both block player.block(Enemy.aiMoveSelector(), enemy.AttackPower); if (player.CurrentMove == Enemy.aiMoveSelector()) { enemy.block(player.CurrentMove, player.AttackPower); } //Player blocks, enemy attacks else if (Enemy.aiMoveSelector() == player.CurrentMove - 1) { enemy.attack(enemy.AttackPower, player.CurrentMove, player.AttackPower, player.Health); Console.WriteLine($"Enemy attack power decresed to: {enemy.AttackPower}"); } //Player blocks, enemy charges else if (Enemy.aiMoveSelector() == player.CurrentMove + 1) { enemy.chargeAttack(player.CurrentMove, player.AttackPower); Console.WriteLine($"Enemy attack power increased to: {enemy.AttackPower}"); } //Player blocks, enemy heals else if (Enemy.aiMoveSelector() == player.CurrentMove + 2) { enemy.heal(player.CurrentMove, player.AttackPower); Console.WriteLine($"Enemy health: {enemy.Health}"); } break; case 'c': //Both charge player.chargeAttack(enemy.CurrentMove, enemy.AttackPower); Console.WriteLine($"Player attack increased to: {player.AttackPower}"); if (player.CurrentMove == Enemy.aiMoveSelector()) { enemy.chargeAttack(player.CurrentMove, player.AttackPower); Console.WriteLine($"Enemy attack increased to: {enemy.AttackPower}"); } //Player charges, enemy attacks else if (Enemy.aiMoveSelector() == player.CurrentMove - 2) { enemy.attack(enemy.AttackPower, player.CurrentMove, player.AttackPower, player.Health); Console.WriteLine($"Your health: {player.Health}"); } //Player charges, enemy blocks else if (Enemy.aiMoveSelector() == player.CurrentMove - 1) { enemy.block(player.CurrentMove, player.AttackPower); } //Player charges, enemy heals else if (Enemy.aiMoveSelector() == player.CurrentMove + 1) { enemy.heal(enemy.CurrentMove, enemy.AttackPower); Console.WriteLine($"Enemy health: {enemy.Health}"); } break; case 'h': //Both heal player.heal(enemy.CurrentMove, enemy.AttackPower); Console.WriteLine($"Your health: {player.Health}"); if (Enemy.aiMoveSelector() == player.CurrentMove) { enemy.heal(player.CurrentMove, player.AttackPower); Console.WriteLine($"Enemy health: {enemy.Health}"); } //Player heals, enemy attacks else if (Enemy.aiMoveSelector() == player.CurrentMove - 3) { enemy.attack(enemy.AttackPower, player.CurrentMove, player.AttackPower, player.Health); Console.WriteLine($"Your health: {player.Health}"); } //Player heals, enemy blocks else if (Enemy.aiMoveSelector() == player.CurrentMove - 2) { Console.WriteLine("Enemy blocks"); } //Player heals, enemy charges else { enemy.chargeAttack(player.CurrentMove, player.AttackPower); Console.WriteLine($"Enemy attack increased to: {enemy.AttackPower}"); } break; case 's': displayStats(player.Name, player.Health, player.AttackPower, enemy.Name, enemy.Health, enemy.AttackPower); break; default: Console.WriteLine("\nIncorrect input"); break; } //Win/Lose condition if (player.Health <= 0) { gameRunning = false; Console.WriteLine("\n\nYou lose"); } else if (enemy.Health <= 0) { gameRunning = false; Console.WriteLine("\n\nYou win"); } } }
public void Get(Fighter enemy) { hp -= enemy.damage; }
public override void onActorMoved(Fighter Fighter, Maps.MovementPath Path, FightCell NewCell) { }
//this function is activated by the buttons onClick function public void MorabarabaButton(int WhichNumber) { if (!Phase_2) { if (Place_Remove) { MorabarabaSpaces[WhichNumber].image.sprite = PlayerIcons[WhoseTurn]; //turns the pressed button to the player who pressed it icon MorabarabaSpaces[WhichNumber].interactable = false; //once the button is pressed cannot be pressed again, this is only for certain phases need to set up exceptions MarkedSpaces[WhichNumber] = WhoseTurn + 1; //identifies what space is marked by who, the +1 if for the checker calculations TurnCounter++; CheckForThreeInaARow(); if (Place_Remove) { if (WhoseTurn == 0) //this switches players and indicaes it by activating the sprites { WhoseTurn = 1; TurnIcons[0].SetActive(false); TurnIcons[1].SetActive(true); PB_MaxPieces = PB_MaxPieces - 1; PB_MaxPieces_Text.text = PB_MaxPieces.ToString(); } else { WhoseTurn = 0; TurnIcons[0].SetActive(true); TurnIcons[1].SetActive(false); PG_MaxPieces = PG_MaxPieces - 1; PG_MaxPieces_Text.text = PG_MaxPieces.ToString(); } } BoardState(); } else if (!Place_Remove) { MorabarabaSpaces[WhichNumber].image.sprite = PlayerIcons[2]; //The Icon is set to blank on press MarkedSpaces[WhichNumber] = -100; //Resets the button's value to -100 to not mess with calculations // CheckForThreeInaARow(); if (WhoseTurn == 0) //this switches players and indicaes it by activating the sprites { WhoseTurn = 1; TurnIcons[0].SetActive(false); TurnIcons[1].SetActive(true); PB_MaxPieces = PB_MaxPieces - 1; PB_MaxPieces_Text.text = PB_MaxPieces.ToString(); } else { WhoseTurn = 0; TurnIcons[0].SetActive(true); TurnIcons[1].SetActive(false); PG_MaxPieces = PG_MaxPieces - 1; PG_MaxPieces_Text.text = PG_MaxPieces.ToString(); } PlaceAPiece(); //CheckForThreeInaARow(); //turn this on if you I want a player to make a 3 in a row on the row a piece was just removed from BoardState(); } } else if (Phase_2) //buttons are chosen to fight { if (!AllFightersChosen) //to check if two fighters are chosen { if (!Player_1_Chosen) //if the first one is chose { if (MarkedSpaces[WhichNumber] == 1 && WhoseTurn == 0) { // Debug.Log("Picked Blue"); WhoseTurn = 1; TurnIcons[0].SetActive(false); TurnIcons[1].SetActive(true); Player_1_Chosen = true; MorabarabaSpaces[WhichNumber].image.sprite = PlayerIcons[2]; MarkedSpaces[WhichNumber] = 101; P1_Fighter_Sprite.image.sprite = PlayerIcons[3]; Button Fighter_1 = MorabarabaSpaces[WhichNumber]; ButtonStatScript P1ButtonValue = Fighter_1.GetComponent <ButtonStatScript>(); Fighter P1 = new Fighter { _Attack = P1ButtonValue.AttackDamage, _Defence = P1ButtonValue.DamageMitigation, _HP = P1ButtonValue.HealthPoints }; Player1_Attack = P1._Attack; Player1_Defence = P1._Defence; Player1_HP = P1._HP; P1_Attack_Max = P1._Attack + Attack_Range; P1_Attack_Min = P1._Attack - Attack_Range; P1_Defence_Max = P1._Defence + Defence_Range; P1_Defence_Min = P1._Defence - Defence_Range; } } else if (Player_1_Chosen) { // Debug.Log("Player 1 has been chosen"); if (MarkedSpaces[WhichNumber] == 2 && WhoseTurn == 1) { // Debug.Log("Picked Orange"); WhoseTurn = 0; TurnIcons[0].SetActive(true); TurnIcons[1].SetActive(false); MorabarabaSpaces[WhichNumber].image.sprite = PlayerIcons[2]; MarkedSpaces[WhichNumber] = 102; P2_Fighter_Sprite.image.sprite = PlayerIcons[4]; Button Fighter_2 = MorabarabaSpaces[WhichNumber]; ButtonStatScript P2ButtonValue = Fighter_2.GetComponent <ButtonStatScript>(); Fighter P2 = new Fighter { _Attack = P2ButtonValue.AttackDamage, _Defence = P2ButtonValue.DamageMitigation, _HP = P2ButtonValue.HealthPoints }; Player2_Attack = P2._Attack; Player2_Defence = P2._Defence; Player2_HP = P2._HP; P2_Attack_Max = P2._Attack + Attack_Range; P2_Attack_Min = P2._Attack - Attack_Range; P2_Defence_Max = P2._Defence + Defence_Range; P2_Defence_Min = P2._Defence - Defence_Range; AllFightersChosen = true; } } } } }
public FightGlypheLayer(Fighter Caster, SpellLevel CastSpell, FightCell CastCell, int MasterSpellId, short Duration, String Zone) : base(FightObjectType.OBJECT_GLYPHE, Caster, CastSpell, CastCell, MasterSpellId, 0, Zone, Duration) { }
protected override void onTouchAtEndTurn(Fighter target) { }
public override void onBeginTurn(Fighter newFighter) { }
public Lapino(Fighter source, SpellLevelRecord level, MapPoint castPoint, bool criticalHit) : base(source, level, castPoint, criticalHit) { }
public override void onWalkOnLayer(Fighter fighter, FightCell newCell) { }
public override void onMiddleTurn(Fighter fighter) { }
void Start() { mover = GetComponent <Mover>(); fighter = GetComponent <Fighter>(); }
/// <summary> /// Supprime les effets de l'invulnerabilité donné par Initmouth. /// </summary> public void DebuffInitmouth() { Fighter.DispellSpellBuffs(Fighter, InitmouthRecord.Id); }
public override void onDie(Fighter fighterDead, Fighter Caster) { }
/// <summary> /// Initialize le Royalmouth au début du combat /// </summary> private void Inimouth() { Fighter.CastSpell(InitmouthRecord, InitmouthRecord.GetLastLevelGrade(), Fighter.CellId, Fighter.CellId, false); }
public void Attack(float dmg, Fighter opponent) { opponent.TakeDamage(dmg); }
private void btnCreate_Click(object sender, RoutedEventArgs e) { Character mycharacter; string chName = txtChName.Text; string class_option = cboxCharacter.Text; switch (class_option) { case "Wizard": mycharacter = new Wizard(chName); break; case "Rogue": mycharacter = new Rogue(chName); break; case "Cleric": mycharacter = new Cleric(chName); break; case "Fighter": mycharacter = new Fighter(chName); break; default: mycharacter = null; MessageBox.Show("You MUST select a class"); break; } if (mycharacter != null) { Weapon myweapon; string wpName = cboxWeapon.Text; string weapon_option = wpName; switch (weapon_option) { case "Axe": myweapon = new Axe(wpName, "Common"); break; case "Bow": myweapon = new Bow(wpName, "Common"); break; case "Dagger": myweapon = new Dagger(wpName, "Common"); break; case "Spear": myweapon = new Spear(wpName, "Common"); break; case "Sword": myweapon = new Sword(wpName, "Common"); break; default: myweapon = null; MessageBox.Show("You MUST select a WEAPON"); break; } if (myweapon != null) { mycharacter.Armament = myweapon; if (cboxArmor.Text != "-Select an Armor-") { Armor myarmor = new Armor(cboxArmor.Text, "Common"); mycharacter.Suit = myarmor; characters.Add(mycharacter); cboxCharacters.Items.Add(mycharacter.Name); txtChName.Text = ""; cboxCharacter.Text = "-Select a Class-"; cboxWeapon.Text = "-Select a Weapon-"; cboxArmor.Text = "-Select an Armor-"; } else { MessageBox.Show("You MUST select an ARMOR"); } } } }
// Use this for initialization void Start() { rb2d = GetComponent <Rigidbody2D>(); controller = fighter.GetComponent <Fighter>(); }
public override void onLeaveFight(Fighter Fighter) { }