Ejemplo n.º 1
0
        public static FoodType GetFoodType(SeedType s)
        {
            switch (s)
            {
            case SeedType.APPLE_SEED:
                return(FoodType.APPLE);

            case SeedType.CARROT_SEED:
                return(FoodType.CARROT);

            case SeedType.WHEAT_SEED:
                return(FoodType.WHEAT);

            case SeedType.POTATO_SEED:
                return(FoodType.POTATO);

            case SeedType.TOMATO_SEED:
                return(FoodType.TOMATO);

            case SeedType.ORANGE_SEED:
                return(FoodType.ORANGE);

            case SeedType.CHERRY_SEED:
                return(FoodType.CHERRY);

            default:
                return(0);
            }
        }
Ejemplo n.º 2
0
    public void TreePlanting(string tag)
    {
        hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
        if (hit.transform != null && hit.transform.tag == tag)
        {
            Debug.Log(hit.transform.tag);
            if (seedType == SeedType.FristSeed)
            {
                isStart = true;
                fristTreeItem.SetActive(false);
                seedIsGet[0] = true;
                buttonGO[0].SetActive(true);
                buttonGO[0].GetComponent <SeedItemBtn>().StartCD();
            }
            else
            {
                buttonGO[(int)seedType].GetComponent <SeedItemBtn>().StartCD();

                if (IsVariation(ref seedType))
                {
                    //变异音效
                    //变异UI提示
                    //显示对应Btn,开始CD
                    buttonGO[(int)seedType].SetActive(true);
                }
                buttonGO[(int)seedType].GetComponent <SeedItemBtn>().StartCD();
            }
            index.SetActive(false);
            Instantiate(Resources.Load <GameObject>("Prefabs/" + treePrefabName[(int)seedType]), new Vector3(hit.point.x, hit.point.y, -1), Quaternion.identity);
            seedType = SeedType.None;
        }
    }
Ejemplo n.º 3
0
        public static String GetName(SeedType s)
        {
            switch (s)
            {
            case SeedType.APPLE_SEED:
                return("Apple Seed");

            case SeedType.CARROT_SEED:
                return("Carrot Seed");

            case SeedType.WHEAT_SEED:
                return("Wheat Seed");

            case SeedType.POTATO_SEED:
                return("Potato Seed");

            case SeedType.TOMATO_SEED:
                return("Tomato Seed");

            case SeedType.ORANGE_SEED:
                return("Orange Seed");

            case SeedType.CHERRY_SEED:
                return("Cherry Seed");

            default:
                return("A seed");
            }
        }
Ejemplo n.º 4
0
        public static long GetGrowTime(SeedType s)
        {
            switch (s)
            {
            case SeedType.APPLE_SEED:
                return(ItemConstants.MEDIUM_GROW_TIME);

            case SeedType.CARROT_SEED:
                return(ItemConstants.MEDIUM_GROW_TIME);

            case SeedType.WHEAT_SEED:
                return(ItemConstants.SHORT_GROW_TIME);

            case SeedType.POTATO_SEED:
                return(ItemConstants.MEDIUM_GROW_TIME);

            case SeedType.TOMATO_SEED:
                return(ItemConstants.LONG_GROW_TIME);

            case SeedType.ORANGE_SEED:
                return(ItemConstants.MEDIUM_GROW_TIME);

            case SeedType.CHERRY_SEED:
                return(ItemConstants.LONG_GROW_TIME);

            default:
                return(0);
            }
        }
Ejemplo n.º 5
0
    private void HandleMoundAction(Collider overlap)
    {
        Mound mound = overlap.GetComponent <Mound>();

        if (mound)
        {
            if (mound.isReadyToHarvest)
            {
                animator.SetTrigger("Action");
                SeedType harvested = mound.GetHarvested();
                Debug.Log(harvested);

                Text scoreUI = GameObject.FindWithTag("Score").GetComponentInChildren <Text>();
                scoreUI.text = (int.Parse(scoreUI.text) + rewards[harvested]).ToString();

                // prevent death
                seedSelector.ResetHealth();
                return;
            }

            if (mound.seedType != SeedType.None && mound.growTime > 0)
            {
                // seed is busy growing
                return;
            }

            SeedType plantedSeed = seedSelector.PlantSeed();
            if (plantedSeed != SeedType.None)
            {
                // plant new seed
                animator.SetTrigger("Action");
                mound.AddSeed(plantedSeed);
            }
        }
    }
Ejemplo n.º 6
0
        private void IntiBasicSetting()
        {
            FilterSheetText.Text            = Global.FilterSheets;
            StartLoadFoldercheckBox.Checked = Global.StartLoadFolder;
            LoadDataCheckBox.Checked        = Global.LoadData;
            ResFolderText.Text         = Global.ResFolder;
            IsDataBaseCheckBox.Checked = Global.IsDataBase;
            IsDisorderCheckBox.Checked = Global.IsDisorder;
            IsResEncCheckBox.Checked   = Global.IsResEnc;
            SeedType type = Global.DisEncType;

            switch (type)
            {
            case SeedType.Version:
                SelectSeedType(VersionCheckBox);
                break;

            case SeedType.CRC32:
                SelectSeedType(CRC32CheckBox);
                break;

            case SeedType.MD5:
                SelectSeedType(MD5CheckBox);
                break;

            case SeedType.SHA1:
                SelectSeedType(SHA1CheckBox);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 7
0
        public void PlayerPlant(Player pg, FieldBlock block)
        {
            SeedType st = pg.GetInventory().getCurrentSeed().Get().GetX();

            block.Plant(st);
            pg.GetInventory().RemoveSeed(st);
        }
Ejemplo n.º 8
0
 public Seed(string song, string artist, string id)
 {
     seedType   = SeedType.Song;
     songName   = song;
     artistName = artist;
     SeedID     = id;
 }
Ejemplo n.º 9
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public Seed(SeedType type)
        {
            this.type = type;

            // Flags for seed's dropped from satchel
            EnablePhysics(
                PhysicsFlags.HasGravity |
                PhysicsFlags.DestroyedOutsideRoom |
                PhysicsFlags.DestroyedInHoles);

            /*
            // Flags for seed Projectiles
            EnablePhysics(
                PhysicsFlags.DestroyedOutsideRoom |
                PhysicsFlags.CollideWorld |
                PhysicsFlags.ReboundSolid |
                PhysicsFlags.HalfSolidPassable |
                PhysicsFlags.LedgePassable);
            */

            Physics.CollisionBox		= new Rectangle2F(-1, -1, 2, 2);
            Physics.SoftCollisionBox	= new Rectangle2F(-1, -1, 2, 2);
            graphics.DrawOffset			= new Point2I(-4, -6);
            centerOffset				= new Point2I(0, -2);
        }
        private string DirectoryForSeedType(SeedType seedType)
        {
            var seedDirectory = string.Empty;

            switch (seedType)
            {
            case SeedType.LANGUAGE:
                seedDirectory = "Language";
                break;

            case SeedType.SETTING:
                seedDirectory = "Setting";
                break;

            default:
                break;
            }

            if (!string.IsNullOrWhiteSpace(seedDirectory))
            {
                return($"{_env.ContentRootPath}/Data/Seeds/{seedDirectory}/");
            }

            return(string.Empty);
        }
Ejemplo n.º 11
0
        public void FillDummy(int playerCount, int seedCount, SeedType type, int aParam)
        {
            List <CompetitionPlayerInfo> players = new List <CompetitionPlayerInfo>();
            Random rnd = new Random();

            for (int i = 0; i < playerCount; i++)
            {
                CompetitionPlayerInfo player = new CompetitionPlayerInfo();
                player.Id       = i + 1;
                player.NickName = "Player " + (i + 1).ToString("d2");
                player.RatingBeforeCompetition = 1500 + rnd.Next(-100, 100);
                players.Add(player);
            }
            SetPlayersList(players.ToArray());
            int[] seed = new int[seedCount];
            for (int i = 0; i < seed.Length; i++)
            {
                if (i % 2 == 0)
                {
                    seed[i] = i / 2 + 1;
                }
                else
                {
                    seed[i] = (seed.Length + 1 + i) / 2;
                }
            }
            SetSeedingOrder(seed, type, aParam);
        }
Ejemplo n.º 12
0
        private void CheckEnvironment()
        {
            if (_env == null)
            {
                return;
            }
            switch (_env.EnvironmentName)
            {
            case "Development":
                SeedType = SeedType.Dev;
                break;

            case "PreProduction":
                SeedType = SeedType.PreProd;
                break;

            case "Production":
                SeedType = SeedType.Prod;
                break;

            default:
                SeedType = SeedType.Dev;
                break;
            }
        }
Ejemplo n.º 13
0
        // Token: 0x06001AB8 RID: 6840 RVA: 0x000724B0 File Offset: 0x000706B0
        internal SeederServerContext(NetworkChannel channel, MonitoredDatabase database, Guid?targetServerGuid, SeedType seedType)
        {
            this.m_channel          = channel;
            this.m_databaseGuid     = database.DatabaseGuid;
            this.DatabaseName       = database.DatabaseName;
            this.SeedType           = seedType;
            this.m_targetServerGuid = targetServerGuid;
            if (database.Config.IsPassiveCopy)
            {
                this.m_fPassiveSeeding = true;
                switch (seedType)
                {
                case SeedType.Database:
                    this.m_passiveSeedingSourceContext = PassiveSeedingSourceContextEnum.Database;
                    break;

                case SeedType.Catalog:
                    this.m_passiveSeedingSourceContext = PassiveSeedingSourceContextEnum.Catalogue;
                    break;
                }
            }
            else
            {
                this.m_passiveSeedingSourceContext = PassiveSeedingSourceContextEnum.None;
            }
            if (!TestSupport.IsCatalogSeedDisabled())
            {
                string indexSystemName = FastIndexVersion.GetIndexSystemName(this.m_databaseGuid);
                this.indexSeederSource = new IndexSeeder(indexSystemName);
            }
        }
Ejemplo n.º 14
0
    public void AddSeed(SeedType type)
    {
        if (type != SeedType.None && seedType == SeedType.None)
        {
            seedType = type;

            if (type == SeedType.MuscleMelon)
            {
                endGrowTime          = MuscleMelonGrowTime;
                currentSeedAnimation = "MuscleMelon_Plant";
            }
            else if (type == SeedType.SkinBean)
            {
                endGrowTime          = SkinBeanGrowTime;
                currentSeedAnimation = "SkinBean_Plant";
            }
            else if (type == SeedType.LiverBerry)
            {
                endGrowTime          = LiverBerryGrowTime;
                currentSeedAnimation = "LiverBerry_Plant";
            }
            else if (type == SeedType.Brainapple)
            {
                endGrowTime          = BrainappleGrowTime;
                currentSeedAnimation = "Brainapple_Plant";
            }
        }
    }
Ejemplo n.º 15
0
        public static double GetPrice(SeedType s)
        {
            switch (s)
            {
            case SeedType.APPLE_SEED:
                return(300);

            case SeedType.CARROT_SEED:
                return(30);

            case SeedType.WHEAT_SEED:
                return(10);

            case SeedType.POTATO_SEED:
                return(50);

            case SeedType.TOMATO_SEED:
                return(100);

            case SeedType.ORANGE_SEED:
                return(500);

            case SeedType.CHERRY_SEED:
                return(1000);

            default:
                return(0);
            }
        }
Ejemplo n.º 16
0
 //-----------------------------------------------------------------------------
 // Overridden methods
 //-----------------------------------------------------------------------------
 public override void OnSeedHit(SeedType seedType, SeedEntity seed)
 {
     if (seedType == SeedType.Ember && !Properties.GetBoolean("lit", false)) {
         Light();
         seed.Destroy();
     }
 }
Ejemplo n.º 17
0
 //-----------------------------------------------------------------------------
 // Overridden methods
 //-----------------------------------------------------------------------------
 public override void OnSeedHit(SeedType seedType, SeedEntity seed)
 {
     if (seedType == SeedType.Mystery && !isActivated) {
         isActivated		= true;
         sparkleIndex	= 0;
         timer			= 0;
     }
 }
Ejemplo n.º 18
0
        //-----------------------------------------------------------------------------
        // Overridden methods
        //-----------------------------------------------------------------------------

        public override void OnSeedHit(SeedType seedType, SeedEntity seed)
        {
            if (seedType == SeedType.Ember && !Properties.GetBoolean("lit", false))
            {
                Light();
                seed.Destroy();
            }
        }
Ejemplo n.º 19
0
 public void RemoveSeed(SeedType type)
 {
     seeds[type]--;
     if (seeds[type] == -1)
     {
         throw new System.InvalidOperationException();
     }
 }
Ejemplo n.º 20
0
 public SeedImpl(SeedType st)
 {
     this.st          = st;
     this.ss          = SeedState.PLANTED;
     this.growTime    = SeedTypeMethods.GetGrowTime(st);
     this.ofWhichFood = SeedTypeMethods.GetFoodType(st);
     WaitGrow();
 }
Ejemplo n.º 21
0
        //-----------------------------------------------------------------------------
        // Internal methods
        //-----------------------------------------------------------------------------

        private Seed DropSeed(SeedType type)
        {
            Seed seed = ThrowSeed(type);

            seed.Position          = Player.Center;
            seed.Physics.Velocity  = Vector2F.Zero;
            seed.Physics.ZVelocity = 0.0f;
            return(seed);
        }
Ejemplo n.º 22
0
        //-----------------------------------------------------------------------------
        // Overridden methods
        //-----------------------------------------------------------------------------

        public override void OnSeedHit(SeedType seedType, SeedEntity seed)
        {
            if (seedType == SeedType.Mystery && !isActivated)
            {
                isActivated  = true;
                sparkleIndex = 0;
                timer        = 0;
            }
        }
Ejemplo n.º 23
0
 public override int GetHashCode()
 {
     var hashCode = -514544316;
     hashCode = hashCode * -1521134295 + SeedType.GetHashCode();
     hashCode = hashCode * -1521134295 + Seed.GetHashCode();
     hashCode = hashCode * -1521134295 + EqualityComparer<Dictionary<SettingType, SettingValue>>.Default.GetHashCode(Settings);
     hashCode = hashCode * -1521134295 + EqualityComparer<List<RandoItemRO>>.Default.GetHashCode(CollectedItems);
     return hashCode;
 }
Ejemplo n.º 24
0
    public SeedType GetHarvested()
    {
        SeedType returnType = seedType;

        seedType         = SeedType.None;
        growTime         = 0;
        isReadyToHarvest = false;
        animator.Play(currentSeedAnimation, 0, 0);
        return(returnType);
    }
Ejemplo n.º 25
0
 private void MoveTop(SeedType type)
 {
     foreach (SeedType seedType in activeSeed.ToArray())
     {
         if (!seedType.Equals(type))
         {
             MoveBottom(seedType);
         }
     }
 }
Ejemplo n.º 26
0
 public Boolean PlayerBuy(Player pg, SeedType st, int quantity)
 {
     if (pg.GetMoney() >= SeedTypeMethods.GetPrice(st) * quantity)
     {
         pg.GetInventory().AddSeeds(st, quantity);
         pg.DecreaseMoney(SeedTypeMethods.GetPrice(st) * quantity);
         return(true);
     }
     return(false);
 }
Ejemplo n.º 27
0
        public async void FindPath(string input, SeedType inputType, BIP0039.WordLists wl, string pass,
                                   string extra, InputType extraType)
        {
            report.Init();

            BIP0032 bip32 = null;

            if (inputType == SeedType.BIP39)
            {
                try
                {
                    bip32 = new BIP0039(input, wl, pass);
                }
                catch (Exception ex)
                {
                    report.Fail($"Could not instantiate BIP-39 instance. Error: {ex.Message}");
                    return;
                }
            }
            else if (inputType == SeedType.Electrum)
            {
                try
                {
                    bip32 = new ElectrumMnemonic(input, wl, pass);
                }
                catch (Exception ex)
                {
                    report.Fail($"Could not instantiate ElectrumMnemonic instance. Error: {ex.Message}");
                    return;
                }
            }
            else if (inputType == SeedType.XPRV || inputType == SeedType.XPUB)
            {
                try
                {
                    bip32 = new BIP0032(input);
                    return;
                }
                catch (Exception ex)
                {
                    report.Fail($"Could not instantiate BIP-32 instance. Error: {ex.Message}");
                }
            }
            else
            {
                report.Fail("Undefined input type.");
                return;
            }

            Debug.Assert(bip32 is not null);

            // TODO: Derive child keys at different known paths to see which one matches the extra input

            report.Finalize();
        }
Ejemplo n.º 28
0
        public PlantSource(Flower parent, SeedType type)
        {
            if (!parent.Plant.SeedTypes.Contains(type))
            {
                throw new ArgumentOutOfRangeException("type", "Растение не размножется таким способом.");
            }

            _parent = parent;
            _plant  = parent.Plant;
            _type   = type;
        }
Ejemplo n.º 29
0
    public GameObject GetSeed(SeedType _ST)
    {
        GameObject seedObject = new GameObject();

        seedObject.transform.position = seedPos;
        SpriteRenderer newSprite = seedObject.AddComponent <SpriteRenderer>();

        newSprite.sprite = _ST.sprites[ec.terrainID];
        seedObject.name  = _ST.name;
        return(seedObject);
    }
        public async Task <SeedType> Get(int id)
        {
            SeedType temp = _seedTypes.Where(x => x.Id == id).FirstOrDefault();

            await Task.Run(() =>
            {
                //Retrieve the SeedType by id from the database or api async
            });

            return(temp);
        }
Ejemplo n.º 31
0
 public IPropertyValueInterceptor GetInterceptor(SeedType type)
 {
     if (!_catalog.ContainsKey(type))
     {
         return(null);
     }
     else
     {
         return(_catalog[type]);
     }
 }
Ejemplo n.º 32
0
 public void AddInterceptor(SeedType t, IPropertyValueInterceptor interceptor)
 {
     if (!_catalog.ContainsKey(t))
     {
         _catalog.Add(t, interceptor);
     }
     else
     {
         _catalog[t] = interceptor;
     }
 }
Ejemplo n.º 33
0
 private void MoveBottom(SeedType type)
 {
     foreach (SeedType s in activeSeed.ToArray())
     {
         if (s.Equals(type))
         {
             activeSeed.Remove(s);
             activeSeed.Add(s);
         }
     }
 }
Ejemplo n.º 34
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public Seed(SeedType type)
            : base(type)
        {
            // Physics.
            Physics.CollisionBox		= new Rectangle2F(-1, -1, 2, 2);
            Physics.SoftCollisionBox	= new Rectangle2F(-1, -1, 2, 2);
            EnablePhysics(
                PhysicsFlags.HasGravity |
                PhysicsFlags.DestroyedOutsideRoom |
                PhysicsFlags.DestroyedInHoles);

            // Graphics.
            Graphics.DepthLayer	= DepthLayer.InAirSeed;
            Graphics.DrawOffset	= new Point2I(-4, -6);
            centerOffset		= new Point2I(0, -2);
        }
Ejemplo n.º 35
0
	// Update is called once per frame
	void Update ()
    {
		// Plant
		if (GameManager.Instance.state == GameManager.GameState.Playing) {
			if (Input.GetButtonDown ("P1_A"))
	        {
				switch (currentSeed) {
				case SeedType.Red:
				case SeedType.Yellow:
				case SeedType.White:
					if (currentTile.GetComponent<PlantTile> ().GetIsInUse () == false)
                    {
                        if(seeds[(int)currentSeed] > 0)
                            {
                                currentTile.GetComponent<PlantTile>().SetIsInUse(true);
                                currentTile.GetComponent<PlantTile>().PlantFlower(currentSeed);
                                seeds[(int)currentSeed]--;
								StartCoroutine (Plant(0.25f));
                                RenderSeeds();
                            }
                        }
					break;
				case SeedType.Water: 
					if (currentTile.GetComponent<PlantTile> ().GetIsInUse () == true) {
						StartCoroutine (Water(0.4f));
					}
					break;
				}
			}

			//Weapon Toggle
			if (Input.GetButtonDown ("P1_R1"))
			{
				int nextSeed = ((int)currentSeed + 1);
				currentSeed = nextSeed >= seeds.Count ? 0 : (SeedType)nextSeed;
				RenderSeeds ();
			}
			else if (Input.GetButtonDown ("P1_L1"))
			{
				int nextSeed = ((int)currentSeed - 1);
				currentSeed = nextSeed < 0 ? (SeedType)(seeds.Count-1) : (SeedType)nextSeed;
				RenderSeeds ();
			}
		}
	}
Ejemplo n.º 36
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public SeedProjectile(SeedType type, bool reboundOffWalls)
            : base(type)
        {
            // Physics.
            Physics.CollisionBox		= new Rectangle2F(-1, -5, 2, 1);
            Physics.SoftCollisionBox	= new Rectangle2F(-1, -5, 2, 1);
            EnablePhysics(
                PhysicsFlags.DestroyedOutsideRoom |
                PhysicsFlags.CollideWorld |
                PhysicsFlags.HalfSolidPassable |
                PhysicsFlags.LedgePassable);

            this.reboundOffWalls = reboundOffWalls;
            if (reboundOffWalls)
                Physics.Flags |= PhysicsFlags.ReboundSolid;

            // Graphics.
            Graphics.DepthLayer	= DepthLayer.InAirSeed;
            Graphics.DrawOffset	= new Point2I(-4, -6);
            centerOffset		= new Point2I(0, -2);
        }
Ejemplo n.º 37
0
        //Return the default grow count, plus a small variation
        public static int getGrowCount(SeedType seedType)
        {
            if(seedType == SeedType.NULL)
            {
                return GRASS_GROW_COUNT + RandomNumber.RandomInteger((GRASS_GROW_COUNT / 10));
            }
            else
            {
                switch(seedType)
                {
                    case SeedType.CORN:
                    return CORN_GROW_COUNT + RandomNumber.RandomInteger((CORN_GROW_COUNT / 20));

                    case SeedType.PUMPKIN:
                    return PUMPKIN_GROW_COUNT + RandomNumber.RandomInteger((PUMPKIN_GROW_COUNT / 4));

                    default:
                    return 1;
                }
            }
        }
Ejemplo n.º 38
0
 //-----------------------------------------------------------------------------
 // Constructor
 //-----------------------------------------------------------------------------
 public SeedEntity(SeedType type)
 {
     this.type = type;
 }
Ejemplo n.º 39
0
 public static InteractionType GetSeedInteractionType(SeedType seedType)
 {
     return (InteractionType) ((int) InteractionType.EmberSeed + (int) seedType);
 }
Ejemplo n.º 40
0
        private Entity CreateEffect(SeedType seedType, bool satchelEffect, Vector2F effectPosition)
        {
            Entity effectEntity = null;

            // Create the seed's effect.
            if (seedType == SeedType.Ember) {
                effectEntity = new Fire();
                AudioSystem.PlaySound(GameData.SOUND_FIRE);
            }
            else if (seedType == SeedType.Scent) {
                if (satchelEffect) {
                    effectEntity = new ScentPod();
                    AudioSystem.PlaySound(GameData.SOUND_SCENT_SEED_POD);
                }
                else {
                    effectEntity = new Effect(GameData.ANIM_EFFECT_SEED_SCENT, DepthLayer.EffectSeed);
                    AudioSystem.PlaySound(GameData.SOUND_SCENT_SEED);
                }
            }
            else if (seedType == SeedType.Mystery) {
                effectEntity = new Effect(GameData.ANIM_EFFECT_SEED_MYSTERY, DepthLayer.EffectSeed);
                AudioSystem.PlaySound(GameData.SOUND_MYSTERY_SEED);
            }
            else if (seedType == SeedType.Pegasus) {
                effectEntity = new Effect(GameData.ANIM_EFFECT_SEED_PEGASUS, DepthLayer.EffectSeed);
                AudioSystem.PlaySound(GameData.SOUND_FIRE);
            }
            else if (seedType == SeedType.Gale) {
                effectEntity = new EffectGale(satchelEffect);
                AudioSystem.PlaySound(GameData.SOUND_GALE_SEED);
            }

            RoomControl.SpawnEntity(effectEntity, effectPosition);
            return effectEntity;
        }
Ejemplo n.º 41
0
 //-----------------------------------------------------------------------------
 // Internal methods
 //-----------------------------------------------------------------------------
 private Seed DropSeed(SeedType type)
 {
     Seed seed = ThrowSeed(type);
     seed.Position = Player.Center;
     seed.Physics.Velocity = Vector2F.Zero;
     seed.Physics.ZVelocity = 0.0f;
     return seed;
 }
Ejemplo n.º 42
0
        //Return the name of a seedType's vine or stalk
        public static String getStemType(SeedType seedType)
        {
            switch(seedType)
            {
                case SeedType.CORN:
                return "stalks";

                case SeedType.PUMPKIN:
                return "vines";

                default:
                return "stems";
            }
        }
Ejemplo n.º 43
0
        //Does this crop spread?
        public static bool spreadingCrop(SeedType seedType)
        {
            switch(seedType)
               {
               case SeedType.CORN:
               return false;

               case SeedType.PUMPKIN:
               return true;

               default:
               return false;
               }
        }
Ejemplo n.º 44
0
        private Seed ThrowSeed(SeedType type)
        {
            Seed seed = new Seed(type);

            Vector2F velocity = Directions.ToVector(Player.Direction);
            Vector2F pos = Player.Origin + (velocity * 4.0f);
            Player.RoomControl.SpawnEntity(seed, pos, Player.ZPosition + 6);
            seed.Physics.Velocity = velocity * 0.75f;

            Player.Graphics.PlayAnimation(GameData.ANIM_PLAYER_THROW);
            Player.BeginBusyState(10);

            return seed;
        }
Ejemplo n.º 45
0
 //-----------------------------------------------------------------------------
 // Interaction Methods
 //-----------------------------------------------------------------------------
 // Called when a seed of the given type hits this tile.
 public virtual void OnSeedHit(SeedType type, SeedEntity seed)
 {
 }