Пример #1
0
 public RemoteDownloader(Zombie zombie)
 {
     InitializeComponent();
     this.zombie = zombie;
     hiddenRadioButton.Checked = true;
     this.Text = zombie.IP + " - " + zombie.computerName + " - Remote Downloader";
 }
Пример #2
0
 public Attack(Zombie zombie, Animation image, int damage, float attSpeed)
     : base(zombie, image)
 {
     this.Damage = damage;
     AttackTimer = new Counter.Timer(this.Game, (int)(1000f / attSpeed));
     AttackTimer.OnMeet += new Counter.EventOnCounterMeet(OnAttackTimerTick);
 }
Пример #3
0
 public static Zombie CreateZombie(Player p)
 {
     Zombie zom = new Zombie(p);
     zom.Graphic = new Sprite("zombie_bmp");
     //fiddle with stats or something
     return zom;
 }
Пример #4
0
 public Attack(Zombie zombie)
     : base(zombie)
 {
     AttackTimer = new Counter.Timer(this.Game, int.MaxValue);
     AttackTimer.OnMeet +=new Counter.EventOnCounterMeet(OnAttackTimerTick);
     this.Damage = 0;
 }
Пример #5
0
	public ZombieState_Locked(Zombie z)
	{
		zombie = z;
		
		lockedTimer = new CountdownTimer();
		lockedTimer.Start (1.0f);
	}
Пример #6
0
 public ZombieState(Zombie zombie, Animation image)
     : base(zombie.Game)
 {
     this.Image = image;
     Align = new Vector2(0, image.SizeY);
     this.Zombie = zombie;
 }
Пример #7
0
    private void OnHit2(Zombie zomb, Vector3 point, Vector3 normal, Transform tr)
    {
        pos = point;
        zomb.transform.position = zomb.pos += (transform.forward * .2f);
        if (!fire)
        {
            zomb.CreateBloodSplatter();
            if (bangRadius == 0)
            {
                //Bs._Game.CreateBlood(point, normal, fire, blood);
                zomb.SetLife(damage, point + normal, 700);
            }
        }

        enabled = false;
        if (bullet || magic)
            Destroy(gameObject);
        else
        {
            transform.position = point;
            transform.forward = -normal;
            transform.parent = tr;
            Destroy(this.gameObject, 5);
            if (fire)
                zomb.StartCoroutine(Bs.AddMethod(.5f, zomb.SetFire));
            Destroy(this);
        }
    }
Пример #8
0
 public ZombieState(Zombie aZombie, Player nPlayer, Map aMap)
 {
     zombie = aZombie;
     player = nPlayer;
     rand = new Random(zombie.ThisID);
     iMap = aMap;
 }
Пример #9
0
	public ZombieState_Frozen(Zombie z)
	{
		zombie = z;
		
		zombie.GetComponent<Rigidbody2D>().velocity = new Vector2(0.0f, 0.0f);
		zombie.GetComponent<Animator>().SetBool ("Frozen", true);
	}
Пример #10
0
	bool isZombieDangerous(Zombie z) {
		bool result = false;

		Vector3 zToS = this.transform.position - z.transform.position;
		Vector3 horizontal = Vector3.Project(zToS, z.direction);
		float vert = (zToS - horizontal).magnitude;
		float hori = horizontal.magnitude;

		float dot = Vector3.Dot(zToS, z.direction);

		float hMax = 0.0f;
		float vMax = 0.0f;


		switch(z.name){
		case "ClassicZombie":
			hMax = 12.0f;
			vMax = 3.0f;
			break;
		case "ShamblerZombie":
			hMax = 12.0f;
			vMax = 4.0f;
			break;
		case "ModernZombie":
			hMax = 12.0f;
			vMax = 4.0f;
			break;
		case "PhoneZombie":
			hMax = 12.0f;
			vMax = 4.0f;
			break;

		}


		if(dot >= 0) {
			//zombie facing survivor
			if(hori < hMax && vert < vMax) {
				result = true;
			}
		}
		else {
			//Zombie behind survivor
			if(z.name == "PhoneZombie"){
				if(hori < hMax && vert < vMax) {
					result = true;
				}
			}
			else{
				if(hori < 3 && vert < 3) {
					result = true;
				}
			}
		}

		
		return result;

	}
Пример #11
0
 public RemoteCMD(Zombie zombie)
 {
     InitializeComponent();
     this.zombie = zombie;
     cmdTextbox.Enabled = false;
     cmdSendButton.Enabled = false;
     this.Text = zombie.IP + " - " + zombie.computerName + " - Remote CMD";
 }
Пример #12
0
    // Use this for initialization
    void Start()
    {
        string[] names = new string[] { "stubbs", "rob", "white" };

        for (int i = 0; i < names.Length; i++)
        {
            Zombie z = new Zombie(names[i], Random.Range(10, 15));
        }
    }
Пример #13
0
 // Use this for initialization
 void Start()
 {
     string[] names=new string[]{"Stubbs", "Rob","White"};
     for(int i=0; i<names.Length; i++)
     {
         Zombie z=new Zombie(names[i],Random.Range (10,15));
         Debug.Log (z.name);
     }
 }
Пример #14
0
    private void newZombie()
    {
        if (zombies.GetLength(0) == 0)
            return;

        this.currentZombie = GameObject.Instantiate(zombies[Random.Range(0, zombies.GetLength(0))]);
        this.currentZombie.transform.position = this.transform.position;
        StartCoroutine(spawnTransition());
    }
Пример #15
0
 //Removes the zombie object and spawns a skeleton in its place
 public void killZombie(Zombie z)
 {
     if (z != null)
     {
         float xCoord = z.gameObject.transform.position.x;
         float zCoord = z.gameObject.transform.position.z;
         zombies.RemoveAt(zombies.IndexOf(z));
         DestroyImmediate(z.gameObject);
         spawnSkeleton(xCoord, zCoord);
     }
 }
Пример #16
0
      static void Main(string[] args)
      {
         string nameOfRelative;
         Console.WriteLine("Will anyone in your family survive the zombie apocalypse?");
         Console.WriteLine("Enter the name of the one MOST likely to survive.");
         nameOfRelative = Console.ReadLine();

         Console.WriteLine();

        string relationtoRelative;
        Console.WriteLine("Enter this person's relationship to this you.");
        relationtoRelative = Console.ReadLine();

         Console.WriteLine();

         Zombie survivor = new Zombie(nameOfRelative,relationtoRelative);//local variables as arguments
         survivor.DisplayInfo();

         Console.ReadKey();
      }//end Main method
Пример #17
0
 protected override void ExecuteBirthCommand(string[] commandWords)
 {
     string organismType = commandWords[1];
     string name = null;
     Point position = default(Point);
     switch (organismType)
     {
         case WolfType:
             name = commandWords[2];
             position = Point.Parse(commandWords[3]);
             Wolf newWolf = new Wolf(name, position);
             this.AddOrganism(newWolf);
             break;
         case LionType:
             name = commandWords[2];
             position = Point.Parse(commandWords[3]);
             Lion newLion = new Lion(name, position);
             this.AddOrganism(newLion);
             break;
         case GrassType:
             position = Point.Parse(commandWords[2]);
             Grass newGrass = new Grass(position);
             this.AddOrganism(newGrass);
             break;
         case BoarType:
             name = commandWords[2];
             position = Point.Parse(commandWords[3]);
             Boar newBoar = new Boar(name, position);
             this.AddOrganism(newBoar);
             break;
         case ZombieType:
             name = commandWords[2];
             position = Point.Parse(commandWords[3]);
             Zombie newZombie = new Zombie(name, position);
             this.AddOrganism(newZombie);
             break;
         default:
             base.ExecuteBirthCommand(commandWords);
             break;
     }
 }
Пример #18
0
 void Start()
 {
     Zombie a = new Zombie();
     Zombie b = new Zombie();
     Debug.Log(a.damage);
     Debug.Log(b.damage);
     Zombie c = a + b;
     Debug.Log(c.damage);
     Supplies supplyA = new Supplies(3);
     Supplies supplyB = new Supplies(9);
     Supplies combinedAB = supplyA + supplyB;
     Debug.Log(combinedAB.weight);
     Supplies sm = new Supplies(5);
     Debug.Log(sm.weight);
     sm = sm * 3;
     Debug.Log(sm.weight);
     a.damage = 9;
     if (a < b)
     {
         Debug.Log("a has less damage!");
     }
 }
Пример #19
0
    IEnumerator respawnZombie()
    {
        respawnInProgress = true;
        float transition = 0.05f;
        currentZombie.GetComponent<CharacterController>().enabled = false;
        currentZombie.GetComponent<SphereCollider>().enabled = false;
        yield return new WaitForSeconds(3f);
        currentZombie.GetComponent<Animator>().enabled = false;
        while (transition < 1f)
        {
            this.currentZombie.transform.position += (Vector3.down * 0.05f);
            transition += 0.05f;
            yield return new WaitForSeconds(0.02f);
        }
        GameObject.DestroyImmediate(this.currentZombie.gameObject);

        yield return new WaitForSeconds(this.timeRespawn);
        this.currentZombie = null;

        this.newZombie();
        respawnInProgress = false;
    }
Пример #20
0
 // Use this for initialization
 void Start()
 {
     z = transform.parent.GetComponent<Zombie>();
 }
Пример #21
0
 public ZombieAnnotation(Zombie zombie)
 {
     _zombie = zombie;
 }
Пример #22
0
 // Use this for initialization
 void Start()
 {
     Zscript = FindObjectOfType <Zombie>();
 }
Пример #23
0
 public WanderState(Zombie aZombie, Player nPlayer)
     : base(aZombie, nPlayer)
 {
     graphic = new Sprite("zombie_wander_bmp");
 }
Пример #24
0
 public PoolZombie(bool _alive, Zombie _zombie, GameObject _zombieObject)
 {
     isAlive   = _alive;
     zombie    = _zombie;
     zombieObj = _zombieObject;
 }
Пример #25
0
        public ActionResult StartAdventure(int AdId)
        {
            Adventure adventure = db.Adventures.Find(AdId);
            Character character = db.Characters.Where(y => y.ApplicationUserID == User.Identity.Name).FirstOrDefault();


            if (character.IsOnAdventure == false)
            {
                if (character.CurrentEnergy >= adventure.AdventureRequerdEnergy)
                {
                    var result = new CharactersController().ManageEnergy(User.Identity.Name, adventure.AdventureRequerdEnergy, this.Request.FilePath);

                    List <ZombieAttackAdventurer> zombies = new List <ZombieAttackAdventurer>();
                    Random rand = new Random();

                    int maxZombieRank = adventure.AdventureID;

                    List <Zombie> selectableZombies = new List <Zombie>();
                    foreach (var zombie in db.Zombies)
                    {
                        if (zombie.ZombieRank <= maxZombieRank && zombie.ZombieRank >= maxZombieRank - 2 && zombie.ZombiePlaceAppear.ToString() == adventure.AdventureType.ToString())
                        {
                            selectableZombies.Add(zombie);
                        }
                    }

                    for (int stepCounter = 1; stepCounter <= adventure.AdventureSteps; stepCounter++)
                    {
                        int maxZombiesPerRound = rand.Next(1, adventure.AdventureMaxZombiesPerRound);

                        for (int j = 0; j < maxZombiesPerRound; j++)
                        {
                            int    zombieIndex    = rand.Next(0, selectableZombies.Count() - 1);
                            Zombie selectedZombie = selectableZombies.ElementAt <Zombie>(zombieIndex);
                            ZombieAttackAdventurer attackingZombie = new ZombieAttackAdventurer {
                                CharacterID = character.CharacterID, State = stepCounter, ZombieID = selectedZombie.ZombieID, ZombieLife = selectedZombie.ZombieLife, isYourTurn = false
                            };
                            db.ZombieAttackAdventurers.Add(attackingZombie);
                        }
                    }

                    character.FinishAdventure      = DateTime.MaxValue;
                    character.AdventureState       = 1;
                    character.AdventureID          = AdId;
                    character.isYourTurn           = true;
                    character.isWaitingOnAdventure = false;

                    character.IsOnAdventure = true;
                    db.SaveChanges();

                    return(RedirectToAction("OnAdventure", "Adventures", new { id = User.Identity.Name }));
                }
                else
                {
                    return(RedirectToAction("Details", "Characters", new { id = User.Identity.Name }));
                }
            }
            else
            {
                return(RedirectToAction("Details", "Characters", new { id = User.Identity.Name }));
            }
        }
Пример #26
0
        public void Summon(Player player, EntityTypeEnum entityType, bool noAi = true, BlockPos spawnPos = null)
        {
            EntityType petType;

            try
            {
                petType = (EntityType)Enum.Parse(typeof(EntityType), entityType.Value, true);
            }
            catch (ArgumentException e)
            {
                return;
            }

            if (!Enum.IsDefined(typeof(EntityType), petType))
            {
                player.SendMessage("No entity found");
                return;
            }

            var coordinates = player.KnownPosition;

            if (spawnPos != null)
            {
                if (spawnPos.XRelative)
                {
                    coordinates.X += spawnPos.X;
                }
                else
                {
                    coordinates.X = spawnPos.X;
                }

                if (spawnPos.YRelative)
                {
                    coordinates.Y += spawnPos.Y;
                }
                else
                {
                    coordinates.Y = spawnPos.Y;
                }

                if (spawnPos.ZRelative)
                {
                    coordinates.Z += spawnPos.Z;
                }
                else
                {
                    coordinates.Z = spawnPos.Z;
                }
            }

            var world = player.Level;

            Mob mob = null;

            EntityType type = (EntityType)(int)petType;

            switch (type)
            {
            case EntityType.Chicken:
                mob = new Chicken(world);
                break;

            case EntityType.Cow:
                mob = new Cow(world);
                break;

            case EntityType.Pig:
                mob = new Pig(world);
                break;

            case EntityType.Sheep:
                mob = new Sheep(world);
                break;

            case EntityType.Wolf:
                mob = new Wolf(world)
                {
                    Owner = player
                };
                break;

            case EntityType.Villager:
                mob = new Villager(world);
                break;

            case EntityType.MushroomCow:
                mob = new MushroomCow(world);
                break;

            case EntityType.Squid:
                mob = new Squid(world);
                break;

            case EntityType.Rabbit:
                mob = new Rabbit(world);
                break;

            case EntityType.Bat:
                mob = new Bat(world);
                break;

            case EntityType.IronGolem:
                mob = new IronGolem(world);
                break;

            case EntityType.SnowGolem:
                mob = new SnowGolem(world);
                break;

            case EntityType.Ocelot:
                mob = new Ocelot(world);
                break;

            case EntityType.Zombie:
                mob = new Zombie(world);
                break;

            case EntityType.Creeper:
                mob = new Creeper(world);
                break;

            case EntityType.Skeleton:
                mob = new Skeleton(world);
                break;

            case EntityType.Spider:
                mob = new Spider(world);
                break;

            case EntityType.ZombiePigman:
                mob = new ZombiePigman(world);
                break;

            case EntityType.Slime:
                mob = new Slime(world);
                break;

            case EntityType.Enderman:
                mob = new Enderman(world);
                break;

            case EntityType.Silverfish:
                mob = new Silverfish(world);
                break;

            case EntityType.CaveSpider:
                mob = new CaveSpider(world);
                break;

            case EntityType.Ghast:
                mob = new Ghast(world);
                break;

            case EntityType.MagmaCube:
                mob = new MagmaCube(world);
                break;

            case EntityType.Blaze:
                mob = new Blaze(world);
                break;

            case EntityType.ZombieVillager:
                mob = new ZombieVillager(world);
                break;

            case EntityType.Witch:
                mob = new Witch(world);
                break;

            case EntityType.Stray:
                mob = new Stray(world);
                break;

            case EntityType.Husk:
                mob = new Husk(world);
                break;

            case EntityType.WitherSkeleton:
                mob = new WitherSkeleton(world);
                break;

            case EntityType.Guardian:
                mob = new Guardian(world);
                break;

            case EntityType.ElderGuardian:
                mob = new ElderGuardian(world);
                break;

            case EntityType.Horse:
                mob = new Horse(world);
                break;

            case EntityType.PolarBear:
                mob = new PolarBear(world);
                break;

            case EntityType.Shulker:
                mob = new Shulker(world);
                break;

            case EntityType.Dragon:
                mob = new Dragon(world);
                break;

            case EntityType.SkeletonHorse:
                mob = new SkeletonHorse(world);
                break;

            case EntityType.Wither:
                mob = new Wither(world);
                break;

            case EntityType.Evoker:
                mob = new Evoker(world);
                break;

            case EntityType.Vindicator:
                mob = new Vindicator(world);
                break;

            case EntityType.Vex:
                mob = new Vex(world);
                break;

            case EntityType.Npc:
                mob = new PlayerMob("test", world);
                break;
            }

            if (mob == null)
            {
                return;
            }
            mob.NoAi = noAi;
            var direction = Vector3.Normalize(player.KnownPosition.GetHeadDirection()) * 1.5f;

            mob.KnownPosition = new PlayerLocation(coordinates.X + direction.X, coordinates.Y, coordinates.Z + direction.Z, coordinates.HeadYaw, coordinates.Yaw);
            mob.SpawnEntity();
        }
Пример #27
0
        private void update_Aim()
        {
            GameObject obj = null;

            if (aim_zombies)
            {
                Zombie z = getNZombie();
                if (z != null)
                {
                    if (obj == null)
                    {
                        obj = z.gameObject;
                    }
                    else
                    {
                        if (tool_ToolZ.getDistance(z.transform.position) < tool_ToolZ.getDistance(obj.transform.position))
                        {
                            obj = z.gameObject;
                        }
                    }
                }
            }

            if (aim_players)
            {
                Player p = getNPlayer();
                if (p != null)
                {
                    if (obj == null)
                    {
                        obj = p.gameObject;
                    }
                    else
                    {
                        if (tool_ToolZ.getDistance(p.transform.position) < tool_ToolZ.getDistance(obj.transform.position))
                        {
                            obj = p.gameObject;
                        }
                    }
                }
            }

            if (aim_animals)
            {
                Animal a = getNAnimal();
                if (a != null)
                {
                    if (obj == null)
                    {
                        obj = a.gameObject;
                    }
                    else
                    {
                        if (tool_ToolZ.getDistance(a.transform.position) < tool_ToolZ.getDistance(obj.transform.position))
                        {
                            obj = a.gameObject;
                        }
                    }
                }
            }

            if (obj != null)
            {
                aim(obj);
            }
        }
Пример #28
0
        public Gameplay(string n1, string n2, string n3, string n4)
        {
            InitializeComponent();
            Maap.Controls.Add(Zombie);
            Maap.Controls.Add(Combi);
            Maap.Controls.Add(lightFire);
            Maap.Controls.Add(hFire1);
            Maap.Controls.Add(Tool);
            Maap.Controls.Add(Food);
            Maap.Controls.Add(Won1);
            Maap.Controls.Add(Won2);
            Maap.Controls.Add(Flu);
            Maap.Controls.Add(Food2);
            Maap.Controls.Add(Food3);
            Food2.BackColor     = Color.Transparent;
            Food3.BackColor     = Color.Transparent;
            Tool.BackColor      = Color.Transparent;
            Food.BackColor      = Color.Transparent;
            Won1.BackColor      = Color.Transparent;
            Won2.BackColor      = Color.Transparent;
            Flu.BackColor       = Color.Transparent;
            lightFire.BackColor = Color.Transparent;
            hFire1.BackColor    = Color.Transparent;
            Combi.BackColor     = Color.Transparent;
            Zombie.BackColor    = Color.Transparent;
            Zombie.Hide();
            lightFire.Hide();
            hFire1.Hide();
            Won2.Hide();
            Tool.Hide();
            Won1.Hide();
            Flu.Hide();
            Food.Hide();
            Food2.Hide();
            Food3.Hide();
            Maap.SendToBack();
            Combi.SendToBack();
            lightFire.BringToFront();
            name1              = n1;
            name2              = n2;
            name3              = n3;
            name4              = n4;
            p1.Namee           = name1;
            p2.Namee           = name2;
            p3.Namee           = name3;
            p4.Namee           = name4;
            l_P1.Text         += p1.Hp;
            l_P2.Text         += p2.Hp;
            l_P3.Text         += p3.Hp;
            l_P4.Text         += p4.Hp;
            l_Food.Text       += chombi.TotalFood;
            l_CombiHp.Text    += chombi.Hp;
            label_Player1.Text = p1.Namee;
            label_Player2.Text = p2.Namee;
            label_Player3.Text = p3.Namee;
            label_Player4.Text = p4.Namee;



            tbGameplayMessage.Text += "Empieza el juego, se encuentran en Yucatan \r\n ";
        }
Пример #29
0
 public void RemoveFromLine(Zombie zombie)
 {
     line.First(x => x.zombie == zombie).zombie = null;
 }
Пример #30
0
        public override void Update(GameTime gameTime)
        {
            if (this.actionHasFinished)
            {
                return;
            }

            MouseState mouseStateCurrent = Mouse.GetState();

            if (actionIsTriggered)
            {
                if (!CurrentPlayer.IsMoving)
                {
                    // Player has stopped moving, so this action is complete.
                    combatActionHandler.handleActionComplete(actionType);
                    this.actionHasFinished = true;
                }
                else
                {
                    // Player is moving, so there isn't anything we need to do
                    return;
                }
            }
            else
            {
                if (!allowUserInteraction())
                {
                    // Current player is under computer control.
                    if (CurrentPlayer.MyType == Player.Type.Zombie)
                    {
                        Zombie zombie        = (Zombie)CurrentPlayer;
                        int    numHexesMoved = zombie.handleCombatChooseMove(this);
                        zombie.subtractActionPointsBy(numHexesMoved);
                        actionIsTriggered = true;
                    }
                }
                else
                {
                    // Current player is under user control.  Wait for a mouse click
                    // Show the path the user may want to take
                    // CombatLocation location = currentPlayer.Location;
                    //List<Hex> hexPath = this.board.highlightPath(location.i, location.j, mousePoint);

                    if (mouseStateCurrent.LeftButton == ButtonState.Pressed && mouseStatePrevious.LeftButton == ButtonState.Released)
                    {
                        Point mousePoint = new Point(mouseStateCurrent.X, mouseStateCurrent.Y);
                        Hex   targetHex  = getTargetHex(mousePoint);
                        if (targetHex != null)
                        {
                            GameEntity gameEntity = targetHex.MyGameEntity;
                            if (gameEntity != null)
                            {
                                actionIsTriggered = true;
                            }
                            else
                            {
                                actionIsTriggered = true;
                            }

                            if (actionIsTriggered)
                            {
                                int numHexesMoved = MyBoard.movePlayer(CurrentPlayer, mousePoint, this);

                                // Subtract the number spaces moved from the player's action points
                                CurrentPlayer.subtractActionPointsBy(numHexesMoved);
                            }
                        }
                    }
                }
            }

            mouseStatePrevious = mouseStateCurrent;
        }
Пример #31
0
 public NodeSelected(Zombie zombie, float currenttime, float duration)
 {
     this.timeselected = currenttime;
     this.duration     = duration;
     this.zombie       = zombie;
 }
Пример #32
0
            protected override void OnTick()
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                Mobile spawn;

                switch (Utility.Random(12))
                {
                default:
                case 0:
                    spawn = new Skeleton();
                    break;

                case 1:
                    spawn = new Zombie();
                    break;

                case 2:
                    spawn = new Wraith();
                    break;

                case 3:
                    spawn = new Spectre();
                    break;

                case 4:
                    spawn = new Ghoul();
                    break;

                case 5:
                    spawn = new Mummy();
                    break;

                case 6:
                    spawn = new Bogle();
                    break;

                case 7:
                    spawn = new RottingCorpse();
                    break;

                case 8:
                    spawn = new BoneKnight();
                    break;

                case 9:
                    spawn = new SkeletalKnight();
                    break;

                case 10:
                    spawn = new Lich();
                    break;

                case 11:
                    spawn = new LichLord();
                    break;
                }

                spawn.MoveToWorld(m_Item.Location, m_Item.Map);

                m_Item.Delete();
            }
Пример #33
0
        private void checkForGameOver(Zombie myZombie)
        {
            if (darwin.isOnTop(myZombie))
            {
                gameOver = true;
            }

            if (darwin.collision)
            {
                Rectangle rightSideOfDarwin = darwin.destination;
                rightSideOfDarwin.X = rightSideOfDarwin.X + board.getSquareWidth();

                Rectangle leftSideOfDarwin = darwin.destination;
                leftSideOfDarwin.X = leftSideOfDarwin.X - board.getSquareWidth();

                Rectangle onTopOfDarwin = darwin.destination;
                onTopOfDarwin.Y = onTopOfDarwin.Y - board.getSquareLength();

                Rectangle onBottomOfDarwin = darwin.destination;
                onBottomOfDarwin.Y = onBottomOfDarwin.Y + board.getSquareLength();


                if (rightSideOfDarwin == myZombie.destination ||
                    leftSideOfDarwin == myZombie.destination ||
                    onTopOfDarwin == myZombie.destination ||
                    onBottomOfDarwin == myZombie.destination)
                {
                    gameOver = true;
                }
            }
        }
Пример #34
0
        void Init(IntPtr pParam)
        {
            // get subsystems

            pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_RESOURCE_MANAGER, out p_sub_sys);
            pResMan = (IResourceManager)p_sub_sys;

            pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_INPUT, out p_sub_sys);
            pInput = (IInput)p_sub_sys;
            pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_RENDER, out p_sub_sys);
            pRender = (IRender)p_sub_sys;
            pRender.GetRender2D(out pRender2D);

            // create arrays
            IEngineBaseObject pObj = null;

            pTextures = new ITexture[TexCount];
            pShadows  = new ITexture[ShadowCount];
            pMeshes   = new IMesh[MeshCount];

            // loading data
            pResMan.Load(RESOURCE_PATH + "sounds\\helicopter.wav", out pObj, 0);
            pSound = (ISoundSample)pObj;
            pSound.PlayEx(out pSoundChannel, E_SOUND_SAMPLE_PARAMS.SSP_LOOPED);

            for (int i = 0; i < TexCount; i++)
            {
                uint flags = TexNames[i].Contains("grass") ? (uint)(E_TEXTURE_LOAD_FLAGS.TLF_FILTERING_BILINEAR | E_TEXTURE_LOAD_FLAGS.TLF_COORDS_REPEAT) : (uint)E_TEXTURE_LOAD_FLAGS.TEXTURE_LOAD_DEFAULT_2D;
                pResMan.Load(RESOURCE_PATH + TexNames[i], out pObj, flags);
                pTextures[i] = (ITexture)pObj;
            }

            pTextures[6].SetFrameSize(256, 256); // zombie sprite splitting

            for (int i = 0; i < MeshCount; i++)
            {
                pResMan.Load(RESOURCE_PATH + MeshNames[i], out pObj, (uint)E_MESH_MODEL_LOAD_FLAGS.MMLF_FORCE_MODEL_TO_MESH);
                pMeshes[i] = (IMesh)pObj;
            }

            // render shadows
            for (int i = 0; i < MeshCount; i++)
            {
                RenderMeshToTexture(out pShadows[i], pMeshes[i], pTextures[i]);
            }

            // render rotor shadow
            pResMan.CreateTexture(out pShadows[5], null, 256, 256, E_TEXTURE_DATA_FORMAT.TDF_RGBA8, E_TEXTURE_CREATION_FLAGS.TCF_DEFAULT, E_TEXTURE_LOAD_FLAGS.TLF_FILTERING_BILINEAR);
            pRender.SetRenderTarget(pShadows[5]);
            TPoint2 coords = new TPoint2(128f, 128f);
            TColor4 col    = TColor4.ColorWhite();

            pRender2D.DrawCircle(ref coords, 100, 64, ref col, E_PRIMITIVE2D_FLAGS.PF_FILL);
            pRender.SetRenderTarget(null);


            // gather, fill and init 3d-objects data
            MyMeshes = new MyMesh[8]
            {
                new MyMesh(pMeshes[0], pTextures[0], pShadows[0], new TPoint2(900f, 500f), new TPoint3(400f, 400f, 500f), 225),
                new MyMesh(pMeshes[0], pTextures[0], pShadows[0], new TPoint2(-250f, 300f), new TPoint3(400f, 400f, 500f), 225),
                new MyMesh(pMeshes[0], pTextures[0], pShadows[0], new TPoint2(800f, 200f), new TPoint3(400f, 400f, 400f), 225),
                new MyMesh(pMeshes[1], pTextures[1], pShadows[1], new TPoint2(0f, 450f), new TPoint3(300f, 300f, 400f), 175),
                new MyMesh(pMeshes[1], pTextures[1], pShadows[1], new TPoint2(50f, 750f), new TPoint3(300f, 300f, 300f), 175),
                new MyMesh(pMeshes[2], pTextures[2], pShadows[2], new TPoint2(500f, 150f), new TPoint3(400f, 400f, 500f), 225),
                new MyMesh(pMeshes[3], pTextures[3], pShadows[3], new TPoint2(180f, 150f), new TPoint3(400f, 400f, 600f), 200),
                new MyMesh(pMeshes[3], pTextures[3], pShadows[3], new TPoint2(600f, 550f), new TPoint3(400f, 400f, 600f), 200, 90)
            };

            copter = new Copter(new MyMesh(pMeshes[4], pTextures[4], pShadows[4], new TPoint2(), new TPoint3(600, 600, 600), 200, 0, true), pTextures[5], pShadows[5]);
            zombie = new Zombie(pTextures[6]);
        }
Пример #35
0
        public override void PlaceBlock(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoords)
        {
            Log.WarnFormat("Player {0} trying to spawn Mob #{1}.", player.Username, Metadata);

            var coordinates = GetNewCoordinatesFromFace(blockCoordinates, face);

            Mob mob = null;

            EntityType type = (EntityType)Metadata;

            switch (type)
            {
            case EntityType.Chicken:
                mob = new Chicken(world);
                break;

            case EntityType.Cow:
                mob = new Cow(world);
                break;

            case EntityType.Pig:
                mob = new Pig(world);
                break;

            case EntityType.Sheep:
                mob = new Sheep(world);
                break;

            case EntityType.Wolf:
                mob = new Wolf(world)
                {
                    Owner = player
                };
                break;

            case EntityType.Villager:
                mob = new Villager(world);
                break;

            case EntityType.MushroomCow:
                mob = new MushroomCow(world);
                break;

            case EntityType.Squid:
                mob = new Squid(world);
                break;

            case EntityType.Rabbit:
                mob = new Rabbit(world);
                break;

            case EntityType.Bat:
                mob = new Bat(world);
                break;

            case EntityType.IronGolem:
                mob = new IronGolem(world);
                break;

            case EntityType.SnowGolem:
                mob = new SnowGolem(world);
                break;

            case EntityType.Ocelot:
                mob = new Ocelot(world);
                break;

            case EntityType.Zombie:
                mob = new Zombie(world);
                break;

            case EntityType.Creeper:
                mob = new Creeper(world);
                break;

            case EntityType.Skeleton:
                mob = new Skeleton(world);
                break;

            case EntityType.Spider:
                mob = new Spider(world);
                break;

            case EntityType.ZombiePigman:
                mob = new ZombiePigman(world);
                break;

            case EntityType.Slime:
                mob = new Slime(world);
                break;

            case EntityType.Enderman:
                mob = new Enderman(world);
                break;

            case EntityType.Silverfish:
                mob = new Silverfish(world);
                break;

            case EntityType.CaveSpider:
                mob = new CaveSpider(world);
                break;

            case EntityType.Ghast:
                mob = new Ghast(world);
                break;

            case EntityType.MagmaCube:
                mob = new MagmaCube(world);
                break;

            case EntityType.Blaze:
                mob = new Blaze(world);
                break;

            case EntityType.ZombieVillager:
                mob = new ZombieVillager(world);
                break;

            case EntityType.Witch:
                mob = new Witch(world);
                break;

            case EntityType.Stray:
                mob = new Stray(world);
                break;

            case EntityType.Husk:
                mob = new Husk(world);
                break;

            case EntityType.WitherSkeleton:
                mob = new WitherSkeleton(world);
                break;

            case EntityType.Guardian:
                mob = new Guardian(world);
                break;

            case EntityType.ElderGuardian:
                mob = new ElderGuardian(world);
                break;

            case EntityType.Horse:
                var random = new Random();
                mob = new Horse(world, random.NextDouble() < 0.10, random);
                break;

            case EntityType.PolarBear:
                mob = new PolarBear(world);
                break;

            case EntityType.Shulker:
                mob = new Shulker(world);
                break;

            case EntityType.Dragon:
                mob = new Dragon(world);
                break;

            case EntityType.SkeletonHorse:
                mob = new SkeletonHorse(world);
                break;

            case EntityType.Wither:
                mob = new Wither(world);
                break;

            case EntityType.Evoker:
                mob = new Evoker(world);
                break;

            case EntityType.Vindicator:
                mob = new Vindicator(world);
                break;

            case EntityType.Vex:
                mob = new Vex(world);
                break;

            case EntityType.Npc:
                mob = new PlayerMob("test", world);
                break;
            }

            if (mob == null)
            {
                return;
            }

            mob.KnownPosition = new PlayerLocation(coordinates.X, coordinates.Y, coordinates.Z);
            mob.NoAi          = true;
            mob.SpawnEntity();

            Log.WarnFormat("Player {0} spawned Mob #{1}.", player.Username, Metadata);

            if (player.GameMode == GameMode.Survival)
            {
                var itemInHand = player.Inventory.GetItemInHand();
                itemInHand.Count--;
                player.Inventory.SetInventorySlot(player.Inventory.InHandSlot, itemInHand);
            }
        }
Пример #36
0
 public Zombie_DieState(FiniteStateMachine stateMachine, Entity entity, string animationName, Zombie zombie) : base(stateMachine, entity, animationName)
 {
     this.zombie = zombie;
 }
Пример #37
0
        public static void OpenCoffin(Mobile from, int item, int level)
        {
            if (Utility.RandomMinMax(1, 10) == 1)                 // 10% CHANCE FOR RAISING DEAD IN COFFINS
            {
                if (item == 0x2800 || item == 0x2801 || item == 0x27E9 || item == 0x27EA || item == 0x27E0 || item == 0x280A || item == 0x2802 || item == 0x2803)
                {
                    int seance = (int)(from.Skills[SkillName.SpiritSpeak].Value);

                    if (!Server.Misc.GetPlayerInfo.LuckyPlayer(from.Luck) && Utility.RandomMinMax(1, 100) > seance)
                    {
                        if (level > 6)
                        {
                            level = 6;
                        }
                        level = level * 3;

                        from.RevealingAction();

                        BaseCreature spawned = new Zombie();

                        switch (Utility.Random(level))
                        {
                        case 0: spawned = new Skeleton(); break;

                        case 1: spawned = new Zombie(); break;

                        case 2: spawned = new Ghoul(); break;

                        case 3: spawned = new Shade(); break;

                        case 4: spawned = new Spectre(); break;

                        case 5: spawned = new Wraith(); break;

                        case 6: spawned = new Phantom(); break;

                        case 7: spawned = new SkeletalWizard(); break;

                        case 8: spawned = new BoneKnight(); break;

                        case 9: spawned = new BoneMagi(); break;

                        case 10: spawned = new SkeletalKnight(); break;

                        case 11: spawned = new SkeletalMage(); break;

                        case 12: spawned = new Mummy(); break;

                        case 13: spawned = new Vampire(); break;

                        case 14: spawned = new Ghostly(); break;

                        case 15: spawned = new Lich(); break;

                        case 16: spawned = new LichLord(); break;

                        case 17: spawned = new RottingCorpse(); break;
                        }

                        string sSaying = "";
                        switch (Utility.Random(9))
                        {
                        case 0: sSaying = "Who has disturbed me!"; break;

                        case 1: sSaying = "You dare steal from my grave?"; break;

                        case 2: sSaying = "Those that take from me will join me!"; break;

                        case 3: sSaying = "Your soul is now mine for the taking!"; break;

                        case 4: sSaying = "Who dares waken me?"; break;

                        case 5: sSaying = "Your life will be extinguished!"; break;

                        case 6: sSaying = "Do you have no respect for the dead?"; break;

                        case 7: sSaying = "I have been waiting to feast off the living!"; break;

                        case 8: sSaying = "Soon you will join my legion of the dead!"; break;
                        }

                        spawned.OnBeforeSpawn(from.Location, from.Map);
                        spawned.Home      = from.Location;
                        spawned.RangeHome = 5;
                        spawned.Title    += " [Awakened]";
                        spawned.MoveToWorld(from.Location, from.Map);
                        spawned.Say(sSaying);
                        spawned.ControlSlots = 666;
                        spawned.Combatant    = from;
                    }
                }
            }
        }
Пример #38
0
 public void Attack(Zombie zombie)
 {
     if (null != ActiveWeapon)
         zombie.Die();
 }
Пример #39
0
 public SearchState(Zombie aZombie, Player nPlayer, Map aMap)
     : base(aZombie, nPlayer, aMap)
 {
     graphic = new Sprite("zombie_search_bmp");
     path    = new List <PathBlock>();
 }
Пример #40
0
    /**
     * sub-FSM for the zombies
     * according to the type of the zombie, we compute the next position where the zombie goes to
     * return true if we computed the next position
     * otherwise return false and we'll compute the position in a later state of the FSM
     */
    public bool behave(Zombie z)
    {
        switch (z.getType())
        {
        case ZombieType.PHONEADDICT:
            float behavior = Random.value;
            if (behavior < 0.25f || !z.moving)              // stop or resume
            {
                if (Random.value < phoneAddictProb[0])
                {
                    z.moving = !z.moving;
                }
                break;
            }
            else if (behavior < 0.5f)               // change speed
            {
                if (Random.value > phoneAddictProb[1])
                {
                    break;
                }
                if (z.speed + incSpeed > speed * 2 || (Random.value < 0.5 && z.speed - incSpeed > speed / 2))
                {
                    z.speed -= incSpeed;
                }
                else
                {
                    z.speed += incSpeed;
                }
                break;
            }
            else if (behavior < 0.75f)               // change lane
            {
                if (Random.value > phoneAddictProb[2])
                {
                    break;
                }
                z.changeNextPos(z.position + z.cn.changeTrack(z.nextCorner, z));
                return(true);
            }
            else               // change direction
            {
                if (Random.value > phoneAddictProb[3])
                {
                    break;
                }
                z.changeDirection();
            }
            break;

        case ZombieType.MODERN:
            if (z.zombieAhead(1))              // change lane
            {
                z.changeNextPos(z.position + z.cn.changeTrack(z.nextCorner, z));
                return(true);
            }
            break;

        case ZombieType.SHAMBLER:
            if (Random.value < shamblerChangeLaneProb)              // change lane
            {
                z.changeNextPos(z.position + z.cn.changeTrack(z.nextCorner, z));
                return(true);
            }
            break;

        default:
            break;
        }
        return(false);
    }
Пример #41
0
 }                 /*   └─────────────────┘*/
                   /*      ┌────────────┐  */
                   /*      │this is an  │  */
 void MakeZombie() /* │instance of │  */
 {                 /*       ┌──────┤a zombie    │  */
     /*       ↓      └────────────┘  */
     Zombie zombie = new Zombie();
 }
Пример #42
0
        public static Entity Create(EntityType entityType, World world)
        {
            Entity entity = null;

            switch (entityType)
            {
            case EntityType.None:
                return(null);

            case EntityType.Chicken:
                entity = new Chicken(world);
                break;

            case EntityType.Cow:
                entity = new Cow(world);
                break;

            case EntityType.Pig:
                entity = new Pig(world);
                break;

            case EntityType.Sheep:
                entity = new Sheep(world);
                break;

            case EntityType.Wolf:
                entity = new Wolf(world);
                break;

            case EntityType.Villager:
                entity = new Villager(world);
                break;

            case EntityType.MushroomCow:
                entity = new Mooshroom(world);
                break;

            case EntityType.Squid:
                entity = new Squid(world);
                break;

            case EntityType.Rabbit:
                entity = new Rabbit(world);
                break;

            case EntityType.Bat:
                entity = new Bat(world);
                break;

            case EntityType.IronGolem:
                entity = new VillagerGolem(world);
                break;

            case EntityType.SnowGolem:
                entity = new Snowman(world);
                break;

            case EntityType.Ocelot:
                entity = new Ocelot(world);
                break;

            case EntityType.Zombie:
                entity = new Zombie(world);
                break;

            case EntityType.Creeper:
                entity = new Creeper(world);
                break;

            case EntityType.Skeleton:
                entity = new Skeleton(world);
                break;

            case EntityType.Spider:
                entity = new Spider(world);
                break;

            case EntityType.ZombiePigman:
                entity = new ZombiePigman(world);
                break;

            case EntityType.Slime:
                entity = new Slime(world);
                break;

            case EntityType.Endermite:
                entity = new Endermite(world);
                break;

            case EntityType.Enderman:
                entity = new Enderman(world);
                break;

            case EntityType.Silverfish:
                entity = new Silverfish(world);
                break;

            case EntityType.CaveSpider:
                entity = new CaveSpider(world);
                break;

            case EntityType.Ghast:
                entity = new Ghast(world);
                break;

            case EntityType.MagmaCube:
                entity = new MagmaCube(world);
                break;

            case EntityType.Blaze:
                entity = new Blaze(world);
                break;

            case EntityType.ZombieVillager:
                entity = new ZombieVillager(world);
                break;

            case EntityType.Witch:
                entity = new Witch(world);
                break;

            case EntityType.Stray:
                entity = new Stray(world);
                break;

            case EntityType.Husk:
                entity = new Husk(world);
                break;

            case EntityType.WitherSkeleton:
                entity = new WitherSkeleton(world);
                break;

            case EntityType.Guardian:
                entity = new Guardian(world);
                break;

            case EntityType.ElderGuardian:
                entity = new ElderGuardian(world);
                break;

            case EntityType.Horse:
                entity = new Horse(world);
                break;

            case EntityType.ZombieHorse:
                entity = new ZombieHorse(world);
                break;

            case EntityType.PolarBear:
                entity = new PolarBear(world);
                break;

            case EntityType.Shulker:
                entity = new Shulker(world);
                break;

            case EntityType.EnderDragon:
                entity = new EnderDragon(world);
                break;

            case EntityType.SkeletonHorse:
                entity = new SkeletonHorse(world);
                break;

            case EntityType.Wither:
                entity = new Wither(world);
                break;

            case EntityType.Evoker:
                entity = new EvocationIllager(world);
                break;

            case EntityType.Vindicator:
                entity = new VindicationIllager(world);
                break;

            case EntityType.Vex:
                entity = new Vex(world);
                break;

            case EntityType.FallingBlock:
                entity = new EntityFallingBlock(world);
                break;

            case EntityType.ArmorStand:
                entity = new EntityArmorStand(world, null);
                break;

            case EntityType.Arrow:
                entity = new ArrowEntity(world, null);
                break;

            case EntityType.Item:
                entity = new ItemEntity(world);
                break;

            case EntityType.Mooshroom:
                entity = new Mooshroom(world);
                break;

            case EntityType.Snowball:
                entity = new SnowballEntity(world, null);
                break;

            case EntityType.ThrownEgg:
                entity = new EggEntity(world, null);

                break;

            case EntityType.Donkey:
                entity = new Donkey(world);
                break;

            case EntityType.Llama:
                entity = new Llama(world);
                break;

            case EntityType.Mule:
                entity = new Mule(world);
                break;

            case EntityType.Fox:
                entity = new Fox(world);
                break;

            case EntityType.Parrot:
                entity = new Parrot(world);
                break;

            case EntityType.Phantom:
                entity = new Phantom(world);
                break;

            case EntityType.Bee:
                entity = new Bee(world);
                break;

            case EntityType.LlamaSpit:
                entity = new LlamaSpit(world);
                break;

            case EntityType.Cat:
                entity = new Cat(world);
                break;

            case EntityType.SmallFireball:
                entity = new SmallFireball(world);
                break;

            case EntityType.Fireball:
                entity = new Fireball(world);
                break;

            case EntityType.Dolphin:
                entity = new Dolphin(world);
                break;

            case EntityType.Cod:
                entity = new Cod(world);
                break;

            case EntityType.PufferFish:
                entity = new PufferFish(world);
                break;

            case EntityType.Salmon:
                entity = new Salmon(world);
                break;

            case EntityType.TropicalFish:
                entity = new TropicalFish(world);
                break;

            case EntityType.FireworkRocket:
                entity = new FireworkRocket(world, null);
                break;

            //case EntityType.Human:
            //entity = new PlayerMob("test", world, );
            //	break;
            default:
                return(null);
            }

            return(entity);
        }
Пример #43
0
    static void Main(string[] args)
    {
        string[]  inputs;
        GameState bestSim        = null;
        int       processingTime = 995;
        int       minScore       = -1;

        // game loop
        while (true)
        {
            var sw = Stopwatch.StartNew();

            var ash = new Point(Console.ReadLine());

            int humanCount = int.Parse(Console.ReadLine());
            var humans     = new Tuple <int, Point> [humanCount];
            for (int i = 0; i < humanCount; i++)
            {
                inputs = Console.ReadLine().Split(' ');
                var h = new Tuple <int, Point>(
                    int.Parse(inputs[0]),
                    new Point(int.Parse(inputs[1]), int.Parse(inputs[2]))
                    );
                humans[i] = h;
            }
            int zombieCount = int.Parse(Console.ReadLine());
            if (minScore < 0)
            {
                minScore = zombieCount * 10;
            }
            var zombies = new Zombie[zombieCount];
            for (int i = 0; i < zombieCount; i++)
            {
                inputs = Console.ReadLine().Split(' ');
                var z = new Zombie {
                    Id      = int.Parse(inputs[0]),
                    Pos     = new Point(int.Parse(inputs[1]), int.Parse(inputs[2])),
                    NextPos = new Point(int.Parse(inputs[3]), int.Parse(inputs[4])),
                };
                zombies[i] = z;
            }

            if (zombieCount > 1)
            {
                var simulations = new SortedDictionary <int, GameState>();
                if (bestSim != null)
                {
                    simulations.Add(bestSim.Points, bestSim);
                }
                while (sw.ElapsedMilliseconds < processingTime)
                {
                    // 1. Every Z is moving toward a Point
                    // 2. That Point only moves if they are chasing Ash.
                    // 3.
                }
                if (simulations.Any())
                {
                    bestSim = simulations.Last().Value;
                    Console.WriteLine(bestSim.Moves.Dequeue());
                }
                else
                {
                    Console.WriteLine(zombies.Last().NextPos);
                }
            }
            else
            {
                Console.WriteLine(zombies[0].NextPos); // Your destination coordinates
            }
            processingTime = 95;
        }
    }
Пример #44
0
 // Encapsulate iterative process of assigning graves to zombies
 void AssignIterativeGrave(Zombie z)
 {
     // Check if graveIterator is within valid range
     if(graveIterator > graves.Count - 1 || graveIterator < 0)
     {
         graveIterator = 0;
     }
     z.SetGraveTarget(graves[graveIterator]);
     graveIterator++;
 }
Пример #45
0
 public SearchState(Zombie aZombie, Player nPlayer, Map aMap)
     : base(aZombie, nPlayer, aMap)
 {
     graphic = new Sprite("zombie_search_bmp");
     path = new List<PathBlock>();
 }
 public abstract void ZombieMove(Zombie context);
Пример #47
0
 public ZombieState(Zombie zombie)
     : base(zombie.Game)
 {
     Align = Vector2.Zero;
     this.Zombie = zombie;
 }
Пример #48
0
 public ZombieWaitTillAtLocation(Blackboard bb, Zombie zombay) : base(bb)
 {
     zBB       = (ZombieBB)bb;
     zombieRef = zombay;
 }
Пример #49
0
	// Use this for initialization
	void Start () {
		Zombie stubbs = new Zombie();
		stubbs.InitZombie();
	}
Пример #50
0
 public ZombieMoveToPlayer(Blackboard bb, Zombie zombay) : base(bb)
 {
     zBB       = (ZombieBB)bb;
     zombieRef = zombay;
 }
Пример #51
0
        private int GetZombieColds(Zombie zombie)
        {
            int nCold = 0;
            foreach (IZombieImpact impact in zombie.Impacts)
            {
                if (impact is Cold)
                    ++nCold;
            }

            return nCold;
        }
Пример #52
0
 public ZombieStopMovement(Blackboard bb, Zombie zombay) : base(bb)
 {
     zombieRef = zombay;
 }
Пример #53
0
        public IActionResult firstEncounter(Player Player1)
        {
            int playerId = (int)HttpContext.Session.GetInt32("PlayerId");
            int?Level    = HttpContext.Session.GetInt32("Level");

            if (Level == 4)
            {
                return(RedirectToAction("GameOver"));
            }
            Story          newStory  = new Story();
            Story          newStory2 = new Story();
            List <Enemies> enemy     = new List <Enemies>();

            if (Level == 1)
            {
                newStory.storyBook   = "On a hot summer day at the Dojo..........The Dojo's AC, which is on the top floor, was destroyed by the Summer Dragon God";
                newStory2.storyBook  = "2 Spiders  2 Zombies and 1 Orc Spawned. You have to take them down before they take you down. heh GOOD LUCK!!!!!";
                newStory.created_at  = DateTime.Now;
                newStory2.created_at = DateTime.Now;
                newStory.PlayerId    = playerId;
                newStory2.PlayerId   = playerId;
                newStory.flag        = 1;
                newStory2.flag       = 1;
                _context.Add(newStory2);
                _context.SaveChanges();
            }
            else if (Level == 2)
            {
                newStory.storyBook   = "Climbed the stairs to the Second Floor as the temperature continues to rise. ";
                newStory2.storyBook  = "4 Spiders  4 Zombies and 2 Orc Spawned. You have to take them down before they take you down. heh GOOD LUCK!!!!!";
                newStory.created_at  = DateTime.Now;
                newStory.PlayerId    = playerId;
                newStory2.created_at = DateTime.Now;
                newStory2.PlayerId   = playerId;
                newStory.flag        = 1;
                newStory2.flag       = 1;
                SetTemp(30);
                _context.Add(newStory2);
            }
            else if (Level == 3)
            {
                newStory.storyBook = "You have reached the third floor. You hear the sound of ping pong balls being smashed. You resist the temptation. The Summer Dragon God appears.......He looks angry. ";
                SetTemp(50);
                newStory.created_at = DateTime.Now;
                newStory.PlayerId   = playerId;
                newStory.flag       = 1;
            }
            _context.Add(newStory);
            if (Level == 3)
            {
                Encounters bossEcounter = new Encounters();
                bossEcounter.PlayerId = playerId;
                bossEcounter.dragons  = 1;
                bossEcounter.totalEnemies++;
                _context.Add(bossEcounter);
                _context.SaveChanges();
                HttpContext.Session.SetInt32("EncounterId", bossEcounter.EncountersId);
                Dragon newDragon = new Dragon();
                newDragon.EncountersId = bossEcounter.EncountersId;
                _context.Add(newDragon);
                _context.SaveChanges();
            }
            else
            {
                Encounters newEcounter = new Encounters();
                newEcounter.PlayerId     = playerId;
                newEcounter.spiders      = 2 * (int)Level;
                newEcounter.zombies      = 2 * (int)Level;
                newEcounter.orcs         = 1 * (int)Level;
                newEcounter.totalEnemies = newEcounter.spiders + newEcounter.zombies + newEcounter.orcs;
                _context.Add(newEcounter);
                _context.SaveChanges();
                HttpContext.Session.SetInt32("EncounterId", newEcounter.EncountersId);
                for (var i = 0; i < newEcounter.spiders; i++)
                {
                    Zombie newZomb = new Zombie();
                    newZomb.EncountersId = newEcounter.EncountersId;
                    Spider newSpid = new Spider();
                    newSpid.EncountersId = newEcounter.EncountersId;
                    _context.Add(newZomb);
                    _context.Add(newSpid);
                    _context.SaveChanges();
                }
                for (var i = 0; i < newEcounter.orcs; i++)
                {
                    Orc newOrc = new Orc();
                    newOrc.EncountersId = newEcounter.EncountersId;
                    _context.Add(newOrc);
                }
            }
            HttpContext.Session.SetObjectAsJson("Enemies", enemy);
            _context.SaveChanges();
            return(RedirectToAction("Moves"));
        }
Пример #54
0
        public Character GetEnemy(int id)
        {
            Character nextChar;

            switch (id)
            {
            //Low level
            case 100:
                nextChar = new Bat();
                return(nextChar);

            case 101:
                nextChar = new Rat();
                return(nextChar);

            case 102:
                nextChar = new Kobold();
                return(nextChar);

            case 103:
                nextChar = new Slime();
                return(nextChar);

            case 104:
                nextChar = new Farmer();
                return(nextChar);

            case 105:
                nextChar = new Imp();
                return(nextChar);

            case 106:
                nextChar = new Zombie();
                return(nextChar);

            case 107:
                nextChar = new Phantom();
                return(nextChar);

            case 108:
                nextChar = new Goblin();
                return(nextChar);

            case 109:
                nextChar = new Witch();
                return(nextChar);

            //Mid level
            case 110:
                nextChar = new Harpy();
                return(nextChar);

            case 111:
                nextChar = new Elemental();
                return(nextChar);

            case 112:
                nextChar = new Nymph();
                return(nextChar);

            case 113:
                nextChar = new Vampire();
                return(nextChar);

            case 114:
                nextChar = new Lamia();
                return(nextChar);

            case 115:
                nextChar = new Qilin();
                return(nextChar);

            case 116:
                nextChar = new Unicorn();
                return(nextChar);

            case 117:
                nextChar = new Jinn();
                return(nextChar);

            case 118:
                nextChar = new Xorn();
                return(nextChar);

            case 119:
                nextChar = new Antlion();
                return(nextChar);

            //High level
            case 120:
                nextChar = new Yeti();
                return(nextChar);

            case 121:
                nextChar = new Orc();
                return(nextChar);

            case 122:
                nextChar = new Minotaur();
                return(nextChar);

            case 123:
                nextChar = new Troll();
                return(nextChar);

            case 124:
                nextChar = new Cyclop();
                return(nextChar);

            case 125:
                nextChar = new Drake();
                return(nextChar);

            default:
                nextChar = new Slime();
                return(nextChar);
            }
        }
Пример #55
0
        public void Initialize()
        {
            gameOverPosition.X = 320;
            gameOverPosition.Y = 130;

            device = graphics.GraphicsDevice;

            gameState = new GameState();
            gameState.setState(GameState.state.Start);
            gameStart = new GameStart(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight);

            board = new GameBoard(new Vector2(33, 25), new Vector2(device.PresentationParameters.BackBufferWidth, device.PresentationParameters.BackBufferHeight));
            darwin = new Darwin(board);

            firstZombie = new Zombie(10, 9, 24, 5, 15, 5, board);
            secondZombie = new Zombie(12, 9, 24, 5, 15, 5, board);
            thirdZombie = new Zombie(8, 8, 24, 5, 15, 5, board);
            fourthZombie = new Zombie(8, 12, 17, 5, 20, 10, board);

            myZombieList= new List<Zombie>();
            myZombieList.Add(firstZombie);
            myZombieList.Add(secondZombie);
            myZombieList.Add(thirdZombie);
            myZombieList.Add(fourthZombie);
            cannibalZombie = new CannibalZombie(29,3,board.getNumSquaresX()-1,1,board.getNumSquaresY()-1,1,myZombieList,darwin,board);

            String zombieString = "This a zombie,\n don't near him \nas a human!!";
            zombieMessage = new MessageBox(board.getPosition(12, 8).X, board.getPosition(10, 10).Y, zombieString);

            String darwinString = "This is darwin,\n move with arrows, \n z to transform, \n a for actions";
            darwinMessage = new MessageBox(board.getPosition(12, 8).X, board.getPosition(10, 10).Y, darwinString);

            String cannibalString = "Cannibal Zombies eat\n other zombies!!\n  Use this to\n your advantage!!";
            cannibalMessage = new MessageBox(board.getPosition(12, 8).X, board.getPosition(10, 10).Y, cannibalString);

            stairs = new Stairs(board);

            removableWalls = setRemovableWallsInLevelTwo();

            // Initial starting position
            darwin.setGridPosition(21, 20);

            if (board.isGridPositionOpen(darwin))
            {
                board.setGridPositionOccupied(darwin.X, darwin.Y);
                darwin.setPosition(board.getPosition(darwin).X, board.getPosition(darwin).Y);
            }

            if (board.isGridPositionOpen(27, 20))
            {
                stairs.setGridPosition(27, 20);
                stairs.setDestination(board.getPosition(27, 20));
            }

            zTime = new ZombieTime(board);
            zTimeReset = new ZombieTime(board);

            setWallsInLevelTwo();

            potion = new Potion(board);
            potion.setDestination(board.getPosition(3,3));
            potion.setGridPosition(3, 3);
        }
Пример #56
0
    // Start is called before the first frame update
    void Start()
    {
        //instasiate the walls


        for (int i = 0; i < 10; i++)
        {
            Wall wall2 = (Instantiate(Wall, new Vector3(Random.Range(-75, 75), 1f, Random.Range(-75, 75)), Quaternion.identity));
            Walls.Add(wall2);
        }



        //GameObject humanRef = GameObject.Find("Human");
        //Human humanScript = humanRef.GetComponent<Human>();

        //for (float i = 0; i < 2; i++)
        //{
        //    humanScript.zombies.Add(Instantiate(Zombie, new Vector3(Random.Range(-75, 75), 1f, Random.Range(-75, 75)), Quaternion.identity));

        //}

        //Human Human2 = Instantiate(Human, new Vector3(Random.Range(-75, 75), 1f, Random.Range(-75, 75)), Quaternion.identity) as Human;
        //Human2.Walls = Walls;

        for (int i = 0; i < numHuman; i++)
        {
            Human Human2 = Instantiate(Human, new Vector3(Random.Range(-75, 75), 1f, Random.Range(-75, 75)), Quaternion.identity) as Human;
            Human2.Walls = Walls;
        }

        var PSG2 = Instantiate(PSG, new Vector3(Random.Range(-75, 75), 1f, Random.Range(-75, 75)), Quaternion.identity);


        //GameObject humanRef = GameObject.Find("Human(Clone)");
        //Human humanScript = humanRef.GetComponent<Human>();

        for (int i = 0; i < numZombie; i++)
        {
            Zombie Zombie2 = Instantiate(Zombie, new Vector3(Random.Range(-75, 75), 1f, Random.Range(-75, 75)), Quaternion.identity) as Zombie;
            Zombie2.Walls = Walls;
        }



        foreach (GameObject zom in GameObject.FindGameObjectsWithTag("Zombie"))
        {
            Debug.Log(zom.name);
            if (zom.name == "Zombie(Clone)")
            {
                Debug.Log(zom.name);
                Zombie zombieScript = zom.GetComponent <Zombie>();
                foreach (GameObject hum in GameObject.FindGameObjectsWithTag("Human"))
                {
                    zombieScript.humans.Add(hum);
                }
            }
        }

        // to fill up the zombie list in human
        foreach (GameObject hum in GameObject.FindGameObjectsWithTag("Human"))
        {
            Debug.Log(hum.name);
            Human humanScript = hum.GetComponent <Human>();
            foreach (GameObject zom in GameObject.FindGameObjectsWithTag("Zombie"))
            {
                humanScript.zombies.Add(zom);
                humanScript.targetTreasure = PSG2;
            }
        }
    }
Пример #57
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player") && target == "player")
     {
         PlayerManager p = other.GetComponent <PlayerManager>();
         p.TakeDamage(strength, PlayerManager.DmgType.Fire);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
     else if (other.CompareTag("Witch") && target == "mob")
     {
         Witch p = other.GetComponent <Witch>();
         p.TakeDamage(strength);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
     else if (other.CompareTag("Zombie") && target == "mob")
     {
         Zombie p = other.GetComponent <Zombie>();
         p.TakeDamage(strength);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
     else if (other.CompareTag("Skeleton") && target == "mob")
     {
         Skeleton p = other.GetComponent <Skeleton>();
         p.TakeDamage(strength);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
     else if (other.CompareTag("GhostBoss") && target == "mob")
     {
         GhostBoss p = other.GetComponent <GhostBoss>();
         p.TakeDamage(strength);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
     else if (other.CompareTag("Snake") && target == "mob")
     {
         var p = other.GetComponent <Snake>();
         p.TakeDamage(strength);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
     else if (other.CompareTag("Scorpion") && target == "mob")
     {
         var p = other.GetComponent <Scorpion>();
         p.TakeDamage(strength);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
     else if (other.CompareTag("Phantom") && target == "mob")
     {
         var p = other.GetComponent <Phantom>();
         p.TakeDamage(strength);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
     else if (other.CompareTag("Haunted") && target == "mob")
     {
         var p = other.GetComponent <Haunted>();
         p.TakeDamage(strength);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
     else if (other.CompareTag("Chest") && target == "mob")
     {
         var p = other.GetComponent <Chest>();
         p.TakeDamage(strength);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
     else if (other.CompareTag("Sarco") && target == "mob")
     {
         var p = other.GetComponent <Sarcophagus>();
         p.TakeDamage(strength);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
     else if (other.CompareTag("KnightSuperBoss") && target == "mob")
     {
         var p = other.GetComponent <KnightSuperBoss>();
         p.TakeDamage(strength);
         if (speed != 0)
         {
             StartCoroutine(Explode());
         }
     }
 }
Пример #58
0
 void Start()
 {
     zombie = GetComponentInParent <Zombie>();
     sp     = GetComponent <SpriteRenderer>();
 }
Пример #59
0
 public Fun(Zombie zombie)
 {
     InitializeComponent();
     this.zombie = zombie;
     this.Text = zombie.IP + " - " + zombie.computerName + " - Fun Manager";
 }
Пример #60
0
        private bool Spawn(PlayerLocation position, EntityType entityType, Random random)
        {
            Level world = Level;
            Mob   mob   = null;

            switch (entityType)
            {
            case EntityType.Chicken:
                mob      = new Chicken(world);
                mob.NoAi = true;
                break;

            case EntityType.Cow:
                mob      = new Cow(world);
                mob.NoAi = true;
                break;

            case EntityType.Pig:
                mob      = new Pig(world);
                mob.NoAi = true;
                break;

            case EntityType.Sheep:
                mob      = new Sheep(world, random);
                mob.NoAi = true;
                break;

            case EntityType.Wolf:
                mob      = new Wolf(world);
                mob.NoAi = true;
                break;

            case EntityType.Horse:
                mob        = new Horse(world, random.NextDouble() < 0.10, random);
                mob.IsBaby = random.NextDouble() < 0.20;
                mob.NoAi   = true;
                break;

            case EntityType.Ocelot:
                mob      = new Ocelot(world);
                mob.NoAi = true;
                break;

            case EntityType.Rabbit:
                mob      = new Rabbit(world);
                mob.NoAi = true;
                break;

            case EntityType.Spider:
                mob      = new Spider(world);
                mob.NoAi = true;
                break;

            case EntityType.Zombie:
                mob        = new Zombie(world);
                mob.IsBaby = random.NextDouble() < 0.05;
                mob.NoAi   = true;
                break;

            case EntityType.Skeleton:
                mob      = new Skeleton(world);
                mob.NoAi = true;
                break;

            case EntityType.Enderman:
                mob      = new Enderman(world);
                mob.NoAi = true;
                break;

            case EntityType.Creeper:
                mob      = new Creeper(world);
                mob.NoAi = true;
                break;
            }

            if (mob == null)
            {
                return(false);
            }

            mob.DespawnIfNotSeenPlayer = true;
            mob.KnownPosition          = position;
            var bbox = mob.GetBoundingBox();

            if (!SpawnAreaClear(bbox))
            {
                return(false);
            }

            ThreadPool.QueueUserWorkItem(state => mob.SpawnEntity());

            if (Log.IsDebugEnabled)
            {
                Log.Debug($"Spawn mob {entityType}");
            }
            return(true);
        }