Beispiel #1
0
        protected override void InternalInitializeLayer(World world, ALevelNode levelNode)
        {
            this.cardPicked    = null;
            this.cardFocused   = null;
            this.domainFocused = null;

            this.playerTurn = null;

            this.nbCardsToPlace = 0;

            this.StarSystem.Clear();
            this.StarLinkSystem.Clear();
            this.StarToLinks.Clear();
            this.StarDomains.Clear();

            //this.DeactivatedCardEntities.Clear();
            this.CardsOffBoard.Clear();
            this.PendingActions.Clear();
            this.NameToOnBoardCardEntities.Clear();

            GalaxyFactory.NameToGalaxyCreators[this.PreInitGalaxyName](this);

            FloatRect galaxyArea = this.GetGalaxyArea();

            (levelNode as CardBoardLevel).BoardBackgroundLayer.Position     = new Vector2f(galaxyArea.Left + galaxyArea.Width / 2f, galaxyArea.Top + galaxyArea.Height / 2f) * (1 / 0.75f);
            (levelNode as CardBoardLevel).BoardBackgroundLayer.StartingArea = new Vector2f(galaxyArea.Width + 1000, galaxyArea.Height + 1000);
        }
Beispiel #2
0
        //kontruktor, játékosok, pakli inicializálása
        public Dealer(int gameMode)
        {
            Structures.IComputer cmp = null;

            switch (gameMode)
            {
                case 1: cmp =  new Computer.ComputerRandom();
                    break;
                case 2: cmp = new Computer.ComputerCallingStation();
                    break;
            }

            Player.Player player_ = new Player.Player(startingStack);

            int[] deck = new int[52];

            for (int i = 0; i < deck.Length; i++)
            {
                deck[i] = i;
            }

            this.Deck = deck;
            this.player = player_;
            this.computer = cmp;
            this.computer.CreateComputer(startingStack, bigBlindValue);
        }
 public Events.Slash RaiseSlashEvent(Player.Player user, Player.Player target)
 {
     return(new Events.Slash(user, target, new List <AbstractCard>()
     {
         this
     }));
 }
        /// <summary>
        /// This function will create a new Unit that belongs to 'owner' and has the UnitStats belonging to 'type'
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="type"></param>
        /// <returns>A new Unit.</returns>
        public Unit createUnit(Player.Player owner, string type)
        {
            Unit u = new Unit(owner, stats[type]);

            u.health = u.stats.maxHealth;
            return(u);
        }
Beispiel #5
0
        //W01cG -- Gen: welcome
        //W02aF -- Fac: welcome to base, faction
        //W03bB -- Bar: a drink?
        //W04bP -- Player: ask for info?
        //W04cP -- Player: ask for info?
        //A01aG -- ask for marker
        //A02aG -- nothing happening, come back
        //A02cG -- bad rep, go away
        //A02dG -- good rep
        //A02eB -- nothing happening
        //A03aG -- the <faction> don't
        //A04aG -- follow up from A03aG. Hate
        //D01aN -- first time here?
        //D01bG -- you suck after the last time
        //D01cG -- you rock after the last time
        //D01dG -- mission aborted
        //D01fG -- you're back, why?
        //D01fGm -- you're back, why?
        //D01hG -- we've spoken before
        //D01kG -- welcome back, mission succeeded
        //D01kGm -- welcome back
        //D02aP -- yeah
        //D02aPm
        //D02bP fail mission, ask for another one
        //D02dP finish mission, ask for another one
        //D02eP yeah, i'm trent
        //D03aN i remember you, good to see you
        //D04aG i could have a match for you, mr ...
        //D04bB well you've come to the right man
        //D05aP
        //D05bP thanks, any action going on?
        //D06aG i see, i work the <faction>
        //D07aG we run this base
        //D07bG we may not own this place but we do have a sizable stack in its operation
        //F01aB well there's a rumor going around, like to hear it?
        //F01bB well i'll tell you, some new information did surface today
        //F01dG just between us mate, i have heard a rumor.
        //F01eG well it is possible i may have some information you can use
        //F01fG your rep will get you wacked, i can fix it for a fee.
        //F01jG i might have a proposition for you
        //F02aP well yes, i'm interested
        //F03bR it's not something you'd really find in the public record
        //F03cR it's a secret my friend
        //F03dR it's very secret
        //F04aG mission rejected - but you don't even have jump gate access to that system yet
        //F04dG mission rejected - you'll need more cargo space for this mission.
        //F04fG mission rejected - you're already on a mission
        //F04gP mission - is it dangerous?
        //F05aG mission - don't worry about it, you'll be just fine
        //F05bG mission - it could be challenging but don't worry about it
        //F05cG mission - well, yeah, it's a bugger
        //F06aP mission - okay, give me the details
        //F07aP mission - i'll take it
        //F07bP rumor reject - that's way too expensive
        //F07cP rumor reject - sorry no deal
        //F08bR rumor accept - okay, this is what i heard
        //F08dR rumor reject - player doesn't have enough money
        //F09bP ??
        //F10aR bye
        //F10bR bye
        //F10bRm bye
        //C01aR ??
        /// <summary>
        ///     W01bB -- Bar: welcome
        /// </summary>
        /// <param name="player"></param>
        /// <param name="npc"></param>
        /// <returns></returns>
        public static List <string> GetScriptsForNPCInteraction(Player.Player player, BaseCharacter npc)
        {
            if (npc.Type == "trader" || npc.Type == "equipment" || npc.Type == "shipdealer")
            {
                return(GetSetSegment("c01ar", npc.Gender, npc.Posture).Scripts);
            }

            if (_index >= Segments.Count)
            {
                _index = 0;
            }

            List <SetSegmentScripts> setl = Segments.ElementAt(_index++).Value;

            foreach (SetSegmentScripts set in setl)
            {
                if (set.Gender && set.Posture)
                {
                    Console.WriteLine(set.SetSegment);
                    var scripts = new List <string>();
                    scripts.AddRange(set.Scripts);
                    return(scripts);
                }
            }
            return(null);
        }
Beispiel #6
0
		} // StartShooting

		void ContinueShooting()
		{
			GameObject player = GLOBALS.gameController.GetSpawnedPlayer();
			float animationShotLight = animator.GetFloat(ANIMATION_SHOT_LIGHT);

			if (1 <= privateGunInfo.shotCount)
			{
				if (animator.GetBool(ANIMATION_IS_PATROLLING))
				{
					StopPatrolling();
				} // if
				if (2 <= privateGunInfo.shotCount)
				{
					privateGunInfo.gunShotLight.enabled = true;
					privateGunInfo.gunShotLight.intensity = gunInfo.flashIntensity * animationShotLight;
					if (!privateGunInfo.hasShotBeenFiredForThisClip)
					{
						if (null == playerScript)
						{
							playerScript = player.GetComponent<Player.Player>();
							if (null == playerScript)
							{
                                General.Logger.LogError("AI", "ContinueShooting", "Could not find player's player script.");
								return;
							} // if
						} // if

						privateGunInfo.hasShotBeenFiredForThisClip = true;
						AudioSource.PlayClipAtPoint(gunInfo.shotClip, privateGunInfo.gunShotLight.transform.position);
						playerScript.TakeDamage(gunInfo.damage);
					} // if
				} // if
			} // if
			transform.LookAt(player.transform.position);
		} // ContinueShooting
Beispiel #7
0
        /// <summary>
        /// Decays the scroll-effect, returns true if the effect has decayed
        /// </summary>
        /// <param name="aPlayer">The player to affect</param>
        /// <returns>Returns true if the scroll-effect has decayed</returns>
        public bool Decay(Player.Player aPlayer)
        {
            int
                tempWWD2 = Console.WindowWidth / 2,
                tempWHD2 = Console.WindowHeight / 2;

            myScrollDuration -= 1;
            if (myScrollDuration <= 0)
            {
                switch (myScrollEffect)
                {
                case ScrollEffect.ARMBUFF:
                    aPlayer.SetTempArmourRating(-myArmourBuff);
                    break;

                case ScrollEffect.HPBUFF:
                    aPlayer.SetTempHealth(-myHealthBuff);
                    break;

                case ScrollEffect.STRBUFF:
                    aPlayer.SetTempStrength(-myStrengthBuff);
                    break;
                }
                aPlayer.PrintUI();
                Console.SetCursorPosition(tempWWD2 - 12, tempWHD2 - 12);
                Console.Write("Scroll-effect wore off!");
                System.Threading.Thread.Sleep(1500);
                return(true);
            }
            return(false);
        }
Beispiel #8
0
        /// <summary>
        /// Method to find if Three of Kind set exist using combination player deck and Discarded Deck card
        /// </summary>
        /// <param name="player">Current player</param>
        /// <param name="card">Top Card Discarded Deck</param>
        /// <returns>1 if straight exist in deck belongs,
        /// -1 if straight exist using combination of deck and @card parameter,
        /// 0 if no straight exist.</returns>
        public static int isThreeOfKind(Player.Player player, Card card)
        {
            Debug.Log("Inside Is Three Of Kind Method with Discard Deck Parameter");
            Deck tempDeck = new Deck(player.GetDeck());

            tempDeck.SortByRankAsc();
            int count = tempDeck.CardsCount();

            for (int i = 0; i < count - 2; i++)
            {
                if (tempDeck.GetCardByIndex(i).GetRankValue() == tempDeck.GetCardByIndex(i + 1).GetRankValue() &&
                    tempDeck.GetCardByIndex(i).GetRankValue() == tempDeck.GetCardByIndex(i + 2).GetRankValue())
                {
                    return(1);
                }
            }
            for (int i = 0; i < count - 1; i++)
            {
                if (tempDeck.GetCardByIndex(i).GetRankValue() == tempDeck.GetCardByIndex(i + 1).GetRankValue() &&
                    tempDeck.GetCardByIndex(i).GetRankValue() == card.GetRankValue())
                {
                    return(-1);
                }
            }
            return(0);
        }
        public override void moveTo(Player.Player player)
        {
            this.hitbox.X = X;
            this.hitbox.Y = Y;

            if (this.X < player.getX())
            {
                this.prevX     = this.X;
                this.direction = Direction.EAST;
                this.X         = this.X + this.movementspeed;
            }

            if (this.Y < player.getY())
            {
                this.prevY     = this.Y;
                this.direction = Direction.SOUTH;
                this.Y         = this.Y + this.movementspeed;
            }

            if (this.X > player.getX())
            {
                this.prevX     = this.X;
                this.direction = Direction.WEST;
                this.X         = this.X - this.movementspeed;
            }

            if (this.Y > player.getY())
            {
                this.prevY     = this.Y;
                this.direction = Direction.NORTH;
                this.Y         = this.Y - this.movementspeed;
            }
        }
 protected override void Initialize()
 {
     player = FindObjectOfType<Player.Player>();
     mechAnima.GetComponent<Animator>();
     mechAnima.SetBool("VertiSlash", true);
     bulletHolster = bullet.GetComponent<Weapons.TornadoHitbox>();
 }
 /// <summary>
 /// Constructor for a unit
 /// </summary>
 /// <param name="owner">Owner</param>
 /// <param name="health">Current Health</param>
 public Unit(Player.Player owner, short health)
     : base(owner, health)
 {
     this.entityType = EntityType.Unit;
     this.stats      = new UnitStats();
     attackStance    = AttackStance.Guard;
 }
Beispiel #12
0
        void Start()
        {
            myLight = GetComponentInChildren <Light>();

            GameObject[] taggedPlayers = GameObject.FindGameObjectsWithTag("Player");

            players       = new GameObject[taggedPlayers.Length];
            playerScripts = new Player.Player[taggedPlayers.Length];

            // Sort tagged players
            for (int i = 0; i < taggedPlayers.Length; i++)
            {
                Player.Player playerScript = taggedPlayers[i].GetComponent <Player.Player>();
                int           playerId     = playerScript.getId();
                int           playerIndex  = playerId - 1;

                players[playerIndex]       = taggedPlayers[i];
                playerScripts[playerIndex] = taggedPlayers[i].GetComponent <Player.Player>();
            }

            // GUI Style
            guiStyle.fontSize         = 24;
            guiStyle.normal.textColor = Color.black;
            guiStyle.clipping         = TextClipping.Clip;
        }
Beispiel #13
0
        public static void SendDeathMessage(Player.Player from, DeathCause cause)
        {
            if (!from.Ship.IsDestroyed)
            {
                //universe
                var rdl = new Rdl();
                rdl.AddTRA(0x19198C00, 0xFFFFFFFF);
                rdl.AddText(from.Name + " died. Type: " + cause);

                var rdlSystem = new Rdl();
                rdlSystem.AddTRA(0x0062FF01, 0xFFFFFFFF);
                rdlSystem.AddText(from.Name + " died. Type: " + cause);

                foreach (var player in from.Runner.Playerlist)
                {
                    if (player.Value.Player.Settings[@"senddeath"] && player.Value.System != from.Ship.System)
                    {
                        SendChatToPlayer(player.Value.Player, rdl);
                    }

                    if (player.Value.Player.Settings[@"sendsystemdeath"] && player.Value.System == from.Ship.System)
                    {
                        SendChatToPlayer(player.Value.Player, rdlSystem);
                    }
                }
            }
        }
Beispiel #14
0
        public void ResetChanges(Creature creature)
        {
            ChangeOfHp = 0;
            ChangeOfMp = 0;

            ChangeOfSpirit    = 0;
            ChangeOfStrength  = 0;
            ChangeOfStamina   = 0;
            ChangeOfDexterity = 0;

            ChangeOfAttack   = 0;
            ChangeOfDefense  = 0;
            ChangeOfAccuracy = 0;
            ChangeOfDodge    = 0;

            ChangeOfCriticalAttackRate    = 0;
            ChangeOfSkillCriticalRate     = 0;
            ChangeOfComboAttackRate       = 0;
            ChangeOfRageModeDuration      = 0;
            ChangeOfReflectChance         = 0;
            ChangeOfBlockDamageChance     = 0;
            ChangeOfArmorBreakRate        = 0;
            ChangeOfAddAttackPowerRate    = 0;
            ChangeOfDrainerRate           = 0;
            ChangeOfSkillDodgeRate        = 0;
            ChangeOfRageAttackDamagerRate = 0;
            ChangeOfRageIncreaseRate      = 0;

            Player.Player player = creature as Player.Player;
            if (player != null)
            {
            }

            creature.Effects.ForEach(effect => effect.Effect.SetImpact(this));
        }
        private IEnumerator DamagePhase(Player.Player player, EnvironmentCard environmentCard)
        {
            var otherPlayer = _playerCollection.GetOtherPlayer(player);

            yield return(environmentCard.Damage(player.CurrentSelectedCard.Card, otherPlayer.CurrentSelectedCard.Card,
                                                _isSurge.Value, _powerSurge, _shielded, _elusive, _isBossFight.Value, _isVictory, player.PlayerId));
        }
Beispiel #16
0
 public static void ChangeMap(Player.Player playr, Map entermap, int enterx, int entery)
 {
     playr.Position.CurMap.Exit(playr);
     playr.Position.X = enterx;
     playr.Position.Y = entery;
     entermap.Enter(playr);
 }
Beispiel #17
0
        protected override void CreateNewPlayer()
        {
            MyPlayer = new Player.Player(CreateInventory(), CreatePet(), new Wallet());
            Shop shop = new Shop();

            MyPlayer.Put(shop.OpenStorage.Show());
        }
Beispiel #18
0
 /// <summary>
 /// Inicializes the players of the strategy.
 /// </summary>
 /// <param name="startMoney"></param>
 protected virtual void InicializePlayers(uint startMoney)
 {
     _player1 = Player.HumanPlayer.GetInstance(startMoney);
     _player2 = Player.ComputerPlayer.GetInstance(startMoney);
     _player1.SetStrategy(this);
     _player2.SetStrategy(this);
 }
Beispiel #19
0
        protected virtual void CreateNewPlayer()
        {
            var kernel = new StandardKernel();
            var dependencyInjection = Ninjector.GetNinjector();

            kernel.Load(dependencyInjection);
            MyPlayer = kernel.Get <Player.Player>();
            MyPlayer.Put(new List <Item>()
            {
                new Food("Banana", 12, 22),
                new Food("Apple", 10, 13),
                new Food("Bread", 5, 7),
                new Soap("Dove", 4, 4),

                new Food("Banana", 12, 22),
                new Food("Apple", 10, 13),
                new Food("Bread", 5, 7),
                new Soap("Dove", 4, 4),

                new Food("Banana", 12, 22),
                new Food("Apple", 10, 13),
                new Food("Bread", 5, 7),
                new Soap("Dove", 4, 4),
            });
            MyPlayer.FeedPet("Apple");
            MyPlayer.FeedPet("Banana");
        }
Beispiel #20
0
        void Start()
        {
            _playerObj = GameObject.FindWithTag("Player");
            _player    = _playerObj.GetComponent <Player.Player>();

            _shrineManager = GameObject.Find("ShrineManager").GetComponent <ShrineManager>();
        }
Beispiel #21
0
 private void BuildHouseAtAllAvailableSpace(Player.Player player)
 {
     foreach (var p in GetAvailableEmptyGrid())
     {
         player.BuyHouse(p, true);
     }
 }
Beispiel #22
0
        public void PlayerRolled(Player.Player player, int rolledCount)
        {
            if (_gameManager.CurrentPlayer != player)
            {
                throw new InvalidActionException("Not your turn.");
            }

            if (player.GetRolledThisTurn())
            {
                throw new InvalidActionException("You have no more rolls left.");
            }

            _gameManager.GameUpdater.PlayerRolledDice(player, rolledCount);

            var place = player.Place;

            for (var i = 0; i < rolledCount; i++)
            {
                place = _gameManager.Board.GetNextPlace(place);
                _gameManager.GameUpdater.PlayerPassedPlace(player, place);
            }

            if (rolledCount != 6)
            {
                player.SetRolledThisTurn(true);
            }

            player.SetPlace(place);
        }
 public void TestInitialize()
 {
     itemToBeAdded     = new List <GameObject>();
     itemToBeDeleted   = new List <GameObject>();
     allObject         = new List <GameObject>();
     testPlayer        = new Player.Player(200, 200);
     testMediator      = new Mediator(allObject, itemToBeAdded, itemToBeDeleted, testPlayer, testRoom, TestState);
     testRoom          = new Room(800, 400, testMediator);
     testMediator.room = testRoom;
     testWall          = new Wall(200, 200, testMediator);
     testMonster       = new Creep.Creep(200, 200, testMediator);
     testMonster2      = new Creep.Creep(200, 200, testMediator);
     HpPlus            = 100;
     testHpBoost       = new HpBoost(HpPlus, 200, 200, testMediator);
     testMSBoost       = new MsBoost(200, 200, testMediator);
     ExpectedMs        = testMSBoost.SpeedBoost;
     testCrossbow      = new Crossbow(200, 200, testMediator);
     testBow           = new FrozenBow(200, 200, testMediator);
     testGun           = new SimpleGun(200, 200, testMediator);
     testWand          = new Wand(200, 200, testMediator);
     testLaveTile      = new LavaTile(200, 200, 5, testMediator);
     testDoor          = new Door(200, 200, testMediator, true);
     FBProjectile      = new FrozenBowProjectile(200, 200, Direction.NORTH, testMediator);
     WProjectile       = new WandProjectile(200, 200, Direction.NORTH, testMediator);
     SGProjectile      = new SimpleGunProjectile(200, 200, Direction.NORTH, testMediator);
     CBProjectile      = new CrossbowProjectile(200, 200, Direction.NORTH, testMediator);
 }
Beispiel #24
0
 public void Release()
 {
     Player  = null;
     Target  = null;
     Buttons = null;
     Rewards = null;
 }
Beispiel #25
0
        private void InitPlayer(Player.Player p, Difficulty.Level level)
        {
            int money = 0;

            switch (level)
            {
            case Difficulty.Level.Easy:
                money = 2000;
                break;

            case Difficulty.Level.Normal:
                money = 3000;
                break;

            case Difficulty.Level.Hard:
                money = 5000;
                break;

            case Difficulty.Level.Demo:
                money = Config.PLAYER_MAX_MONEY;
                break;
            }

            p.SetMoney(money);
        }
Beispiel #26
0
        public static void CastTeleport(Player.LeafSpell spell, Player.Player caster, int x, int y)
        {
            var tpdist = (spell.Level / 2) * 2;

            // if (tpdist <= 3) tpdist = 4;
            if (tpdist > 12)
            {
                tpdist = 12;
            }

            if (Point2D.Distance(caster.Position.X, caster.Position.Y, x, y) > tpdist)
            {
                return;
            }

            var tile = caster.Position.CurMap.GetTile(x, y);

            if (tile == null || tile.WalkFlags == 0)
            {
                return;
            }

            caster.Position.X = x;
            caster.Position.Y = y;

            caster.Position.CurMap.Events.OnTele(caster);
        }
        private IEnumerator AttackPhase(Player.Player player)
        {
            var environmentCard = _environmentDeck.GetByPlayer(player.PlayerId);
            var card            = player.CurrentSelectedCard.Card as PlayerCard;

            yield return(ActionPhase(card, player));

            _environmentDeck.UpdateAll();
            yield return(new WaitForSeconds(.5f));

            _environmentDeck.UpdateAll();
            yield return(DamagePhase(player, environmentCard));

            _environmentDeck.UpdateAll();
            yield return(new WaitForSeconds(.5f));

            if (environmentCard.Value > 0)
            {
                yield return(DefensePhase(player, environmentCard));
            }
            else
            {
                yield return(RevengePhase(player, environmentCard));
            }

            _environmentDeck.UpdateAll();
            yield return(new WaitForSeconds(.5f));

            if (card != null)
            {
                card.Duration--;
            }
        }
Beispiel #28
0
        public void UpdateCard(Player.Player owner, Card card)
        {
            if (_card != null)
            {
                _card.OnCardChanged -= UpdateText;
            }

            _owner = owner;
            _card  = card;

            card.OnCardChanged += UpdateText;

            _valueImage.sprite  = card.ValueBackground;
            _borderImage.sprite = card.CardFrame;
            UpdateText();
            _valueTextMesh.text = card.Value.ToString();
            _cardImage.sprite   = card.Sprite;

            foreach (Transform child in _fractionTransform)
            {
                Destroy(child.gameObject);
            }

            foreach (var fraction in card.Fractions)
            {
                SpawnFractionIcon(fraction);
            }
        }
Beispiel #29
0
 public void Release()
 {
     Player = null;
     Target = null;
     Buttons = null;
     Rewards = null;
 }
Beispiel #30
0
        void player_PlayerDeleted(object sender, Player.Player e)
        {
            //var revent = next_event as DPGameRunnerPlayerDeletedEvent;

            // fixme: might crash if the player leaves
            if (!Players.ContainsKey(e.FLPlayerID))
            {
                return;
            }

            var player = Players[e.FLPlayerID];

            Players.Remove(e.FLPlayerID);
            if (player.Ship.Objid != 0)
            {
                DelSimObject(player.Ship);
            }

            if (Playerlist.ContainsKey(e.FLPlayerID))
            {
                Playerlist.Remove(e.FLPlayerID);
            }

            foreach (var item in Playerlist.Values)
            {
                Packets.SendPlayerListDepart(item.Player, player);
            }
        }
Beispiel #31
0
        private void NextPlayer()
        {
            var foundCurrPlayer = false;

            Player.Player foundNextPlayer = null;
            foreach (var player in _gameManager.Players)
            {
                if (foundCurrPlayer)
                {
                    foundNextPlayer = player;
                }

                if (_gameManager.CurrentPlayer == player)
                {
                    foundCurrPlayer = true;
                }
            }

            if (foundNextPlayer == null)
            {
                foundNextPlayer = _gameManager.Players.First();
            }

            SetCurrentPlayer(foundNextPlayer);
        }
Beispiel #32
0
        public static Card CreateThreeOfKind(Player.Player player, Card topCard)
        {
            Card removedcard = null;

            Deck tempDeck = new Deck(player.GetDeck());

            tempDeck.SortByRankDesc();
            int count = tempDeck.CardsCount();

            for (int i = 0; i < count - 1; i++)
            {
                if (tempDeck.GetCardByIndex(i).GetRankValue() == tempDeck.GetCardByIndex(i + 1).GetRankValue() &&
                    tempDeck.GetCardByIndex(i).GetRankValue() == topCard.GetRankValue())
                {
                    if (i - 1 >= 0)
                    {
                        removedcard = tempDeck.Remove(tempDeck.GetCardByIndex(i - 1));
                    }
                    else
                    {
                        removedcard = tempDeck.Remove(tempDeck.GetCardByIndex(i + 2));
                    }
                    break;
                }
            }
            return(removedcard);
        }
Beispiel #33
0
 public void OnPickup(Player.Player player)
 {
     player.MaxHealth += 1;
     player.Health     = player.MaxHealth;
     player.Play("Get_Heart");
     QueueFree();
 }
Beispiel #34
0
 void FixedUpdate()
 {
     player = GetComponentInParent<LobbyPlayer>().gamePlayer;
     if (player) {
         text.text = player.kills + "/" + player.deaths;
     } else {
         text.text = "0/0";
     }
 }
        Player.Player zombiePlayer; // Zombie Player (enemy)

        #endregion Fields

        #region Constructors

        public Scenario(int width, int height)
        {
            this.width = width;
            this.height = height;
            worldPlayer = new Player.Player(WORLD_PLAYER);
            player = new Player.Player(PLAYER);
            zombiePlayer = new Player.Player(ZOMBIE_PLAYER);
            gameWorld = new GameWorld.GameWorld(width, height);
        }
Beispiel #36
0
 public override void Start()
 {
     if (player == null)
     {
         base.Start();
         AquireEntity(0, spawnPoint, Enums.Direction.Right);
         player = FindObjectOfType<Player.Player>();
     }
 }
Beispiel #37
0
 public override void Start()
 {
     if (player == null)
     {
         base.Start();
         AquireEntity(0, spawnPoint, Enums.Direction.Right, deathHandler.GetComponent<Callback>());
         player = FindObjectOfType<Player.Player>();
         camera = FindObjectOfType<CameraTracker>();
     }
 }
Beispiel #38
0
        public GameController(MainWindow parentWindow, string playerOne, string PlayerTwo)
        {
            // Create new instances of player - objects, assign name
            this.Player1 = new Player.Player(playerOne,1);
            this.Player2 = new Player.Player(PlayerTwo,2);
            this.parentWindow = parentWindow;

            this.Player1.color = (SolidColorBrush)parentWindow.cPlayer1Color.Background;
            this.Player2.color = (SolidColorBrush)parentWindow.cPlayer2Color.Background;
        }
Beispiel #39
0
        public Dialog(Player.Player player, Npc.Npc target, int special, int dialogId, int stage = 1)
        {
            Player = player;
            Target = target;
            Special = special;
            DialogId = dialogId;
            Stage = stage;

            Buttons = new List<DialogButton>();
            Rewards = new List<QuestReward>();
        }
Beispiel #40
0
        public Pitch(GameController gameController)
            : base()
        {
            base.Width = 50*GameController.PITCH_X;
            base.Height = 50;
            this.playerOne = gameController.Player1;
            this.playerTwo = gameController.Player2;

            for (var i = 0; i < FieldArray.Length; i++)
                FieldArray[i] = new Field(i);
        }
        public Entity(Player.Player owner, short health, short maxHealth)
        {
            this.owner = owner;
            this.health = health;
            this.maxHealth = health;

            state = new State();
            actionQueue = new Queue<ActionCommand>();

            this.entityType = EntityType.NotSet;

            // Give this entity a unique id.
            this.id = nextID;
            nextID++;
        }
Beispiel #42
0
        void Awake()
        {
            hand = new Image[MAX_HAND];
            cards = new string[MAX_HAND];

            thisPlayerIndex = ++playerIndex;
            player = GameObject.Find("Player " + playerIndex).GetComponent<Player.Player>();
            GameObject[] gos = GameObject.FindGameObjectsWithTag("Hand").OrderBy(go => go.name).ToArray();
            for (int i = 0; i < gos.Length; i++)
            {
                gos[i].tag = "Hand " + thisPlayerIndex.ToString();
                hand[i] = gos[i].GetComponent<Image>();
            }
            currentCardName = GameObject.Find("Current Hand Card").GetComponent<Text>();

            canvas = this.GetComponent<Canvas>();
            Hide();
        }
Beispiel #43
0
        public void Update(GameTime gameTime, Player.Player player, GameWorld map)
        {
            this._gameTime = gameTime;
            this._player = player;
            this._gameWorld = map;

            AnimateHeart();
            RotateHeart();
            PumpHeart();

            if (_currentHealth < player.Health)
            {
                _currentHealth++;
            }
            if (_currentHealth > player.Health)
            {
                _currentHealth--;
            }

            if (_maxHealth < player.MaxHealth)
            {
                _maxHealth++;
            }
            if (_maxHealth > player.MaxHealth)
            {
                _maxHealth--;
            }

            if (_oldCurrentHealth < player.Health)
            {
                GameWorld.ParticleSystem.Add(new SplashNumber(player, player.Health - _oldCurrentHealth, Color.Green));
                _oldCurrentHealth = player.Health;
            }

            if (_oldCurrentHealth > player.Health)
            {
                GameWorld.ParticleSystem.Add(new SplashNumber(player, player.Health - _oldCurrentHealth, Color.Red));
                _oldCurrentHealth = player.Health;
            }
        }
        void Start()
        {
            anim = this.GetComponent<Animator>();

            //should find players provided they are named in the fashion: "Player 1" or "Player 42"
            thisPlayerIndex = ++playerIndex;
            player = GameObject.Find("Player " + playerIndex).GetComponent<Player.Player>();

            deck = player.Deck;
            selectionOptions = new List<Card>();
            selectedCards = new List<Card>();
            finalMap = new List<int>();

            selectionButtons = new Toggle[NUM_SELECTIONS];
            finalButtons = new Toggle[MAX_SELECTIONS];
            GameObject[] gos = GameObject.FindGameObjectsWithTag("Selection").OrderBy(go => go.name).ToArray();
            for(int i = 0; i < gos.Length; i++)
            {
                gos[i].tag = "Selection " + thisPlayerIndex.ToString();
                selectionButtons[i] = gos[i].GetComponent<Toggle>();
            }

            gos = GameObject.FindGameObjectsWithTag("Final").OrderBy(go => go.name).ToArray();
            for (int i = 0; i < gos.Length; i++)
            {
                gos[i].tag = "Final " + thisPlayerIndex.ToString();
                finalButtons[i] = gos[i].GetComponent<Toggle>();
            }

            okayButton = GameObject.Find("Okay").GetComponent<Button>();
            okayButton.transform.name = "Okay " + thisPlayerIndex.ToString();

            DrawPossibleSelections();
            InitializeDisplayData();
            UpdateFinalDisplayData();
        }
Beispiel #45
0
        public void Start(Canvas canvasPitch)
        {
            if (this.parentWindow == null)
                throw new NotImplementedException("GameController.parentWindow must not be null.");

            CurrentPlayer = Player1;
            gameOver = false;
            Winner = null;

            // Create pitch, Add monster
            double margin = 0.0d;
            for (int i = 0; i < PITCH_Y; i++)
            {
                pitchLevel[i] = new Pitch(this);
                Canvas.SetTop(pitchLevel[i], margin);
                canvasPitch.Children.Add(pitchLevel[i].GetPitch());
                margin += 50.0d;
            }

            parentWindow.bEndRound.Visibility = Visibility.Visible;
            parentWindow.tWinner.Visibility = Visibility.Hidden;
            UpdateRound();
        }
Beispiel #46
0
 private void changePlayer()
 {
     CurrentPlayer = (CurrentPlayer.ID == 1) ? Player2 : Player1;
     CurrentPlayer.ActionsLeft = 3;
 }
Beispiel #47
0
        public bool TryLoadFromFile(GameMode currentGameMode)
        {
            LoadingScreen.LoadingText = "Where did I put that file?";
            byte[] tileIDs = WorldData.TileIDs;
            byte[] wallIDs = WorldData.WallIDs;

            LoadingScreen.LoadingText = "Starting up world...";
            this.CurrentGameMode = currentGameMode;
            Main.ObjectiveTracker.Clear();
            CloudList = new List<Cloud>();
            KeyList = new List<Key>();
            Entities = new List<Entity>();
            Particles = new List<Particle>();
            ChunkManager = new ChunkManager();

            Player = Game1.Player;

            int width = WorldData.LevelWidth;
            int height = WorldData.LevelHeight;

            if (WorldData.MetaData == null)
                WorldData.MetaData = new string[width * height];

            int maxClouds = width / 100;
            for (int i = 0; i < maxClouds; i++)
            {
                CloudList.Add(new Cloud(new Vector2(Main.UserResWidth, Main.UserResHeight), maxClouds, i));
            }

            TileArray = new Tile[tileIDs.Length];
            WallArray = new Tile[tileIDs.Length];

            LoadingScreen.LoadingText = "Getting tiles from junkyard...";
            ConvertToTiles(TileArray, tileIDs);
            ConvertToTiles(WallArray, wallIDs);

            LoadingScreen.LoadingText = "Lighting up the world...";
            LightEngine.Load();

            _playerLight = new Light();

            LoadingScreen.LoadingText = "Finding cardboard backgrounds...";
            Background.Load();

            LoadingScreen.LoadingText = "Wait, you are editing it???";
            if (currentGameMode == GameMode.Edit)
                LevelEditor.Load();

            _placeNotification.Show(WorldData.LevelName);

            try
            {
                ChunkManager.ConvertToChunks(WorldData.LevelWidth, WorldData.LevelHeight);
            }
            catch (ArgumentException e)
            {
                Main.MessageBox.Show(e.Message);
                return false;
            }

            return true;
        }
 protected override void Initialize()
 {
     player = FindObjectOfType<Player.Player>();
     mechAnima.GetComponent<Animator>();
     mechAnima.SetBool("HoriSlash", true);
 }
Beispiel #49
0
        protected override void Initialize()
        {
            meleeHitbox.Owner = this.gameObject;
            meleeHitbox.DeathTime = .5f;

            meleeEffect.transform.Rotate(Vector3.up, 180f);

            transform.position = currentNode.transform.position;
            player = FindObjectOfType<Player.Player>();
        }
        void Start()
        {
            //should find players provided they are named in the fashion: "Player 1" or "Player 42"
            thisPlayerIndex = ++playerIndex;
            player = GameObject.Find("Player " + playerIndex).GetComponent<Player.Player>();
            deck = player.Deck;
            selectionOptions = new List<Card>();
            selectedCards = new List<Card>();
            finalMap = new List<int>();

            selectionButtons = new GameObject[NUM_SELECTIONS];
            finalButtons = new Image[MAX_SELECTIONS];
            GameObject[] gos = GameObject.FindGameObjectsWithTag("Selection").OrderBy(go => go.name).ToArray();
            for (int i = 0; i < NUM_SELECTIONS; i++)
            {
                gos[i].tag = "Selection " + thisPlayerIndex.ToString();
                selectionButtons[i] = gos[i];
            }

            gos = GameObject.FindGameObjectsWithTag("Final").OrderBy(go => go.name).ToArray();
            for (int i = 0; i < MAX_SELECTIONS; i++)
            {
                gos[i].tag = "Final " + thisPlayerIndex.ToString();
                finalButtons[i] = gos[i].GetComponent<Image>();
            }

            if (xboxButtons == null)
            {
                xboxButtons = new Image[xboxButtonSprites.Count];
                gos = GameObject.FindGameObjectsWithTag("Xbox Button").OrderBy(go => go.name).ToArray();
                for (int i = 0; i < NUM_SELECTIONS * 2; i++)
                {
                    xboxButtons[i] = gos[i].GetComponent<Image>();
                }

                xboxButtons[0].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard0, thisPlayerIndex)));
                xboxButtons[1].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard1, thisPlayerIndex)));
                xboxButtons[2].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard2, thisPlayerIndex)));
                xboxButtons[3].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard3, thisPlayerIndex)));
                xboxButtons[4].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard4, thisPlayerIndex)));
                xboxButtons[5].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard5, thisPlayerIndex)));
                xboxButtons[6].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard6, thisPlayerIndex)));
                xboxButtons[7].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard7, thisPlayerIndex)));

                xboxButtons[8].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard0, thisPlayerIndex)));
                xboxButtons[9].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard1, thisPlayerIndex)));
                xboxButtons[10].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard2, thisPlayerIndex)));
                xboxButtons[11].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard3, thisPlayerIndex)));
                xboxButtons[12].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard4, thisPlayerIndex)));
                xboxButtons[13].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard5, thisPlayerIndex)));
                xboxButtons[14].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard6, thisPlayerIndex)));
                xboxButtons[15].sprite = xboxButtonSprites.Find(x => x.name.Contains(CustomInput.gamePadButton(CustomInput.UserInput.PickCard7, thisPlayerIndex)));
            }

            DrawPossibleSelections();
            InitializeDisplayData();
            UpdateFinalDisplayData();
        }
Beispiel #51
0
 protected override void Initialize()
 {
     player = FindObjectOfType<Player.Player>();
     mechAnima.GetComponent<Animator>();
 }
Beispiel #52
0
 protected override void Initialize()
 {
     player = FindObjectOfType<Player.Player>();
 }
 // Use this for initialization
 void Start()
 {
     this.Instance = this;
     this.player = playerManager.GetPlayer();
 }
Beispiel #54
0
        void Start()
        {
            //should find players provided they are named in the fashion: "Player 1" or "Player 42"
            player = GameObject.Find("Player " + ++playerIndex).GetComponent<Player.Player>();

            deck = player.Deck;
            selectionOptions = new Hand();
            selectedCards = new Hand();

            selectionButtons = new Toggle[NUM_SELECTIONS];
            GameObject[] gos = GameObject.FindGameObjectsWithTag("Selection").OrderBy(go => go.name).ToArray();
            for(int i = 0; i < gos.Length; i++)
            {
                selectionButtons[i] = gos[i].GetComponent<Toggle>();
            }
            DrawPossibleSelections();
        }