private void InitContents( BarrelType type ) { Item item = null; byte count = (byte)Utility.RandomMinMax( 10, 30 ); for( byte i = 0; i < count; i++ ) { switch( type ) { default: case BarrelType.Arrows: item = new Arrow( Utility.RandomMinMax( 2, 6 ) ); break; case BarrelType.Bolts: item = new Bolt( Utility.RandomMinMax( 2, 6 ) ); break; case BarrelType.Farming: { if( i > 3 ) return; switch( Utility.Random( 3 ) ) { case 0: item = new Shovel(); break; case 1: item = new Scythe(); break; case 2: item = new Pitchfork(); break; } break; } case BarrelType.LargeMining: { if( i > 5 ) return; switch( Utility.Random( 5 ) ) { case 0: item = new Pitchfork(); break; case 1: case 2: item = new Shovel(); break; case 3: case 4: item = new Pickaxe(); break; } break; } case BarrelType.LargeWeapon1: case BarrelType.LargeWeapon2: case BarrelType.LargeWeapon3: { if( i > 6 ) return; switch( Utility.Random( 6 ) ) { case 0: item = new Spear(); break; case 1: item = new Halberd(); break; case 2: item = new Axe(); break; case 3: item = new ThinLongsword(); break; case 4: item = new WarAxe(); break; case 5: item = new VikingSword(); break; } break; } case BarrelType.Mining: { if( i > 3 ) return; item = new Pickaxe(); break; } case BarrelType.Spears: { if( i > 4 ) return; item = new Spear(); break; } case BarrelType.Weapons: { if( i > 3 ) return; switch( Utility.Random( 3 ) ) { case 0: item = new WarAxe(); break; case 1: item = new WarMace(); break; case 2: item = new Maul(); break; } break; } } if( item != null ) DropItem( item ); } }
public InternalBuyInfo() { Add(new GenericBuyInfo("Pickaxe", typeof(Pickaxe), Pickaxe.GetSBPurchaseValue(), 50, 0xE86, 0)); Add(new GenericBuyInfo("Shovel", typeof(Shovel), Shovel.GetSBPurchaseValue(), 50, 0xF39, 0)); Add(new GenericBuyInfo("Hatchet", typeof(Hatchet), Hatchet.GetSBPurchaseValue(), 50, 0xF43, 0)); Add(new GenericBuyInfo("Lockpick", typeof(Lockpick), Lockpick.GetSBPurchaseValue(), 250, 0x14FC, 0)); Add(new GenericBuyInfo("Scissors", typeof(Scissors), Scissors.GetSBPurchaseValue(), 50, 0xF9F, 0)); Add(new GenericBuyInfo("Tongs", typeof(Tongs), Tongs.GetSBPurchaseValue(), 50, 0xFBB, 0)); Add(new GenericBuyInfo("SledgeHammer", typeof(SledgeHammer), SledgeHammer.GetSBPurchaseValue(), 50, 0xFB5, 0)); Add(new GenericBuyInfo("SmithHammer", typeof(SmithHammer), SmithHammer.GetSBPurchaseValue(), 50, 0x13E3, 0)); Add(new GenericBuyInfo("MortarPestle", typeof(MortarPestle), MortarPestle.GetSBPurchaseValue(), 50, 0xE9B, 0)); Add(new GenericBuyInfo("TinkerTools", typeof(TinkerTools), TinkerTools.GetSBPurchaseValue(), 50, 0x1EB8, 0)); Add(new GenericBuyInfo("SewingKit", typeof(SewingKit), SewingKit.GetSBPurchaseValue(), 50, 0xF9D, 0)); Add(new GenericBuyInfo("Skillet", typeof(Skillet), Skillet.GetSBPurchaseValue(), 50, 0x97F, 0)); Add(new GenericBuyInfo("RollingPin", typeof(RollingPin), RollingPin.GetSBPurchaseValue(), 50, 0x1043, 0)); Add(new GenericBuyInfo("MapmakersPen", typeof(MapmakersPen), MapmakersPen.GetSBPurchaseValue(), 50, 0x0FBF, 0)); Add(new GenericBuyInfo("ScribesPen", typeof(ScribesPen), ScribesPen.GetSBPurchaseValue(), 50, 0x0FBF, 0)); Add(new GenericBuyInfo("Scorp", typeof(Scorp), Scorp.GetSBPurchaseValue(), 50, 0x10E7, 0)); Add(new GenericBuyInfo("DrawKnife", typeof(DrawKnife), DrawKnife.GetSBPurchaseValue(), 50, 0x10E4, 0)); Add(new GenericBuyInfo("Saw", typeof(Saw), Saw.GetSBPurchaseValue(), 50, 0x1034, 0)); Add(new GenericBuyInfo("DovetailSaw", typeof(DovetailSaw), DovetailSaw.GetSBPurchaseValue(), 50, 0x1028, 0)); Add(new GenericBuyInfo("Froe", typeof(Froe), Froe.GetSBPurchaseValue(), 50, 0x10E5, 0)); Add(new GenericBuyInfo("Hammer", typeof(Hammer), Hammer.GetSBPurchaseValue(), 50, 0x102A, 0)); Add(new GenericBuyInfo("Inshave", typeof(Inshave), Inshave.GetSBPurchaseValue(), 50, 0x10E6, 0)); Add(new GenericBuyInfo("JointingPlane", typeof(JointingPlane), JointingPlane.GetSBPurchaseValue(), 50, 0x1030, 0)); Add(new GenericBuyInfo("WoodenPlane", typeof(WoodenPlane), WoodenPlane.GetSBPurchaseValue(), 50, 0x102C, 0)); Add(new GenericBuyInfo("SmoothingPlane", typeof(SmoothingPlane), SmoothingPlane.GetSBPurchaseValue(), 50, 0x1032, 0)); }
public OverlandTreasureHunter() { SpeechHue = Utility.RandomDyedHue(); Title = "the treasure hunter"; SetStr(96, 115); SetDex(86, 105); SetInt(51, 65); SetDamage(23, 27); SetSkill(SkillName.Anatomy, 60.0, 82.5); SetSkill(SkillName.Wrestling, 88.5, 100.0); SetSkill(SkillName.MagicResist, 88.5, 100.0); SetSkill(SkillName.Tactics, 60.0, 82.5); Fame = 2500; Karma = -2500; // Configure our treasuremap TreasureMap map = new TreasureMap(5, Map.Felucca); map.LootType = LootType.Newbied; map.Themed = true; map.Theme = TreasureTheme.RandomOverlandTheme(); map.Decoder = this; PackItem(map); // configure our distination (to the chest) Destination = new Point3D(map.ChestLocation, 0).ToString(); Shovel shovel = new Shovel(); shovel.LootType = LootType.Newbied; PackItem(shovel); Runebook book = new Runebook(); book.LootType = LootType.Newbied; book.Name = "Fromm's treasure hunting guide"; AddItem(book); Item light = null; if (Utility.RandomBool()) { light = new Lantern(); } else { light = new Torch(); } PackItem(light); // select a gem for payment m_GemIndex = Utility.Random(TreasureMapChest.m_GemTypes.Length); m_GemsRequired = 50 * (2 + Utility.Random(9)); // 100-500 PackItem(new Bandage(Utility.RandomMinMax(1, 15))); }
public InternalSellInfo() { Add(typeof(Pickaxe), Pickaxe.GetSBSellValue()); Add(typeof(Shovel), Shovel.GetSBSellValue()); Add(typeof(Lockpick), Lockpick.GetSBSellValue()); Add(typeof(Scissors), Scissors.GetSBSellValue()); Add(typeof(Tongs), Tongs.GetSBSellValue()); Add(typeof(SledgeHammer), SledgeHammer.GetSBSellValue()); Add(typeof(SmithHammer), SmithHammer.GetSBSellValue()); Add(typeof(MortarPestle), MortarPestle.GetSBSellValue()); Add(typeof(TinkerTools), TinkerTools.GetSBSellValue()); Add(typeof(SewingKit), SewingKit.GetSBSellValue()); Add(typeof(Skillet), Skillet.GetSBSellValue()); Add(typeof(RollingPin), RollingPin.GetSBSellValue()); Add(typeof(MapmakersPen), MapmakersPen.GetSBSellValue()); Add(typeof(ScribesPen), ScribesPen.GetSBSellValue()); Add(typeof(Scorp), Scorp.GetSBSellValue()); Add(typeof(DrawKnife), DrawKnife.GetSBSellValue()); Add(typeof(Saw), Saw.GetSBSellValue()); Add(typeof(DovetailSaw), DovetailSaw.GetSBSellValue()); Add(typeof(Froe), Froe.GetSBSellValue()); Add(typeof(Hammer), Hammer.GetSBSellValue()); Add(typeof(Inshave), Inshave.GetSBSellValue()); Add(typeof(JointingPlane), JointingPlane.GetSBSellValue()); Add(typeof(WoodenPlane), WoodenPlane.GetSBSellValue()); Add(typeof(SmoothingPlane), SmoothingPlane.GetSBSellValue()); }
protected void Digging() { if (Channeling(ItemList.Shovel, PlayerActions.Dig) == PlayerActions.Dig) { Shovel s = (Shovel)(this.GetPlayerData().GetInventory()[Global.ItemNames[ItemList.Shovel]]); s.Dig(this.GetPlayerData(), this); } }
void Awake() { tank = FindObjectOfType <FakeTank_Manager>(); shovel = shovel_interactable.GetComponent <Shovel>(); //shovelStart = new Transform (); shovelStartpos = shovel.transform.position; shovelStartRot = shovel.transform.rotation; }
public InternalBuyInfo() { Add(new GenericBuyInfo("Pickaxe", typeof(Pickaxe), Pickaxe.GetSBPurchaseValue(), 50, 0xE86, 0)); Add(new GenericBuyInfo("Shovel", typeof(Shovel), Shovel.GetSBPurchaseValue(), 50, 0xF39, 0)); Add(new AnimalBuyInfo(1, "Pack Horse", typeof(PackHorse), PackHorse.GetSBPurchaseValue(), 10, 0x123, 0)); Add(new AnimalBuyInfo(1, "Pack Horse", typeof(PackLlama), PackLlama.GetSBPurchaseValue(), 10, 0x124, 0)); }
public static Shovel.Value MasterMindRun(Shovel.Instruction[] bytecode, List<Shovel.SourceFile> sources) { System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch (); sw.Reset (); sw.Start (); var result = Shovel.Api.TestRunVm (bytecode, sources); sw.Stop (); Console.WriteLine (sw.ElapsedMilliseconds / 1000.0); return result; }
void Start() { CutSceneManager.instance.ShowCutScene(0, 1, false, 3.0f, false, StartGame); /* At start you can shovel, but you can't draw, aim, look around, or move */ // 1 Shovel.Activate(); //Draw.Deactivate (); //Aim.Deactivate (); //LookAround.Deactivate (); movementScript.enabled = false; }
//void CoalHasCleared () { // Drawer.DrawerMoveToStairButton (); //} public void ShardHit() { /* Now you cannot shovel, still can't draw or aim, but you can move and look around. * Obstruction disappears. */ // 4 Shovel.Deactivate(); //LookAround.Activate (ShowDrawerCutScene); LookAround.instance.Look(ShowDrawerCutScene); //movementScript.enabled = true; Obstruction.RemoveObstruction(); }
/// <summary> /// Action of shovel selection /// </summary> /// <param name="shovel">interacting shovel</param> /// <param name="isShowing">display or hide the information</param> private void Item_OnShovelSelected(Shovel shovel, bool isShowing) { if (isShowing) { ShowShovelInfoWindow(shovel); } else { CloseShovelInfoWindow(); } }
public override void OnResponse(NetState state, RelayInfo info) { PlayerMobile m = m_user; ToolBox box = i_box; BaseTool tool; BaseHarvestTool toola; Hatchet toolh; Container pack = m.Backpack; switch (info.ButtonID) { default: { break; } case 2: { box.OW(m); break; } case 3: { tool = new Tongs(); tool.UsesRemaining = box.i_S; pack.DropItem(tool); box.i_S = 0; break; } case 4: { tool = new MouldingPlane(); tool.UsesRemaining = box.i_C; pack.DropItem(tool); box.i_C = 0; break; } case 5: { tool = new TinkerTools(); tool.UsesRemaining = box.i_Ti; pack.DropItem(tool); box.i_Ti = 0; break; } case 6: { tool = new SewingKit(); tool.UsesRemaining = box.i_T; pack.DropItem(tool); box.i_T = 0; break; } case 7: { toolh = new Hatchet(); toolh.UsesRemaining = box.i_L; pack.DropItem(toolh); box.i_L = 0; break; } case 8: { tool = new ScribesPen(); tool.UsesRemaining = box.i_Sc; pack.DropItem(tool); box.i_Sc = 0; break; } case 9: { toola = new Shovel(); toola.UsesRemaining = box.i_M; pack.DropItem(toola); box.i_M = 0; break; } case 10: { tool = new Skillet(); tool.UsesRemaining = box.i_Co; pack.DropItem(tool); box.i_Co = 0; break; } case 11: { tool = new FletcherTools(); tool.UsesRemaining = box.i_F; pack.DropItem(tool); box.i_F = 0; break; } case 12: { tool = new MortarPestle(); tool.UsesRemaining = box.i_A; pack.DropItem(tool); box.i_A = 0; break; } case 13: { tool = new MalletAndChisel(); tool.UsesRemaining = box.i_St; pack.DropItem(tool); box.i_St = 0; break; } case 14: { tool = new MapmakersPen(); tool.UsesRemaining = box.i_Ca; pack.DropItem(tool); box.i_Ca = 0; break; } case 15: { GargoylesPickaxe item = new GargoylesPickaxe(); item.UsesRemaining = box.i_Garg; pack.DropItem(item); box.i_Garg = 0; break; } case 16: { ProspectorsTool item = new ProspectorsTool(); item.UsesRemaining = box.i_Pros; pack.DropItem(item); box.i_Pros = 0; break; } case 17: { Blowpipe item = new Blowpipe(); item.UsesRemaining = box.i_G; pack.DropItem(item); box.i_G = 0; break; } } if (info.ButtonID > 2) { box.NG(m, box); } }
public override void OnThink() { if (this.Region.IsPartOf(typeof(HouseRegion))) { m_NextUse = DateTime.Now + TimeSpan.FromSeconds(2.5); } else if (this.Alive && this.m_Mine && this.m_NextUse <= DateTime.Now && Loyalty > 50) { Container backpack = this.Backpack; if (backpack == null) { m_NextUse = DateTime.Now + TimeSpan.FromSeconds(2.5); base.OnThink(); return; } if (backpack.TotalWeight >= backpack.MaxWeight || backpack.TotalItems >= backpack.MaxItems) { m_NextUse = DateTime.Now + TimeSpan.FromSeconds(2.5); base.OnThink(); return; } Shovel shovel = (Shovel)backpack.FindItemByType(typeof(Shovel)); //Shovel shovel = (Shovel)backpack.FindItemByType(typeof(Shovel)); if (shovel != null) { if (this.DoDisposeOre(this.X, this.Y, this.Z, this.Map, this)) { shovel.UsesRemaining -= 1; if (shovel != null && !shovel.Deleted && shovel.UsesRemaining <= 0) { shovel.Delete(); } } } else if (shovel != null) { if (this.DoDisposeOre(this.X, this.Y, this.Z, this.Map, this)) { shovel.UsesRemaining -= 1; if (shovel != null && !shovel.Deleted && shovel.UsesRemaining <= 0) { shovel.Delete(); } } } m_NextUse = DateTime.Now + TimeSpan.FromSeconds(2.5); } base.OnThink(); }
public TerrainEditorControl(TgcTerrainEditor terrainEditor) { // TODO: Complete member initialization this.terrainEditor = terrainEditor; InitializeComponent(); //Tab General createHeightmapBrowser(); pictureBoxModifyHeightmap.ImageLocation = heightmapBrowser.SelectedImage; textureBrowser = new TgcTextureBrowser(); textureBrowser.ShowFolders = true; textureBrowser.setSelectedImage(GuiController.Instance.ExamplesMediaDir + "Heighmaps\\" + "TerrainTexture1-256x256.jpg"); pictureBoxModifyTexture.ImageLocation = textureBrowser.SelectedImage; terrainEditor.Terrain.loadHeightmap(heightmapBrowser.SelectedImage, (float)nudScaleXZ.Value, (float)nudScaleY.Value, new Microsoft.DirectX.Vector3(0, 0, 0)); terrainEditor.Terrain.loadTexture(textureBrowser.SelectedImage); shovel = new Shovel(); vegetationBrush = new VegetationBrush(); steamroller = new Steamroller(); vegetationPicker = new VegetationPicker(); //Tooltips toolTip1.SetToolTip(rbShovel, "Pala.\nAumenta la altura del terreno.\nShovel sound by adough1@freesound"); toolTip1.SetToolTip(rbSteamroller, "Aplanadora.\nNivela el terreno\nSteamroller stock image by presterjohn1@deviantArt"); toolTip1.SetToolTip(tbRadius, "Regula el tamaño del pincel"); toolTip1.SetToolTip(tbIntensity, "Regula la intesidad del efecto del pincel"); toolTip1.SetToolTip(tbHardness, "Regula el tamaño del radio interno.\nA medida que los vertices se alejan del radio interno, la intensidad disminuye."); toolTip1.SetToolTip(cbRounded, "Cuando se deselecciona, el pincel es cuadrado"); toolTip1.SetToolTip(cbInvert, "Invierte el efecto del pincel.\n(La pala hunde, la aplanadora aumenta los desniveles)"); toolTip1.SetToolTip(bChangeFolder, "La carpeta seleccionada debe contener carpetas con\nel mismo nombre que el -TgcScene.xml que llevan dentro."); //Camera terrainEditor.Camera.MovementSpeed = tbCameraMovementSpeed.Value; terrainEditor.Camera.JumpSpeed = tbCameraJumpSpeed.Value; //Info setInfo(); folderBrowserDialog1.SelectedPath = InstancesManager.Location; //Vegetation fillVegetationList(InstancesManager.Location); }
void UpdateShovel() { ShovelRenderer.Flip = direction > 0f ? SpriteRenderer.FlipMode.None : SpriteRenderer.FlipMode.Horizontal; var currentTime = (float)Time.GameTimer.TotalSeconds; var process = MathF.Clamp((currentTime - startTime) / AnimTime, 0, 1); if (currentTime > startTime + AnimTime + StayTime) { Playing = false; return; } var dir = MathF.Sign(direction); var newPos = Vector2.Lerp(StartPos * dir, EndPos * dir, ExpDistort(process)); Shovel.MoveTo(new Vector3(newPos, Shovel.RelativePos.Z)); byte alpha = (byte)(255 * process); ShovelRenderer.ColorTint = new Duality.Drawing.ColorRgba(255, alpha); }
/// <summary> /// Display the information of the selected shovel /// </summary> /// <param name="shovel">shovel info to display</param> public void Setup(Shovel shovel) { shovelNameText.text = shovel.Name; Report report = reportsManager.GetReportByID(shovel.ID); if (report != null) { comparisionText.text = $"{100 * report.Performance / report.PlannedPerformance} %"; performanceBarImage.fillAmount = report.Performance / report.PlannedPerformance; performanceText.text = report.Performance.ToString(); plannedPerformanceText.text = report.PlannedPerformance.ToString(); foreach (Transform item in statesContent) { Destroy(item.gameObject); } foreach (var item in report.LastStates) { GameObject stateUI = Instantiate(stateUIPrefab, statesContent); stateUI.GetComponent <ShovelStateUI>().Setup(item); } } }
public InternalSellInfo() { Add(typeof(Pickaxe), Pickaxe.GetSBSellValue()); Add(typeof(Shovel), Shovel.GetSBSellValue()); }
static Session FreshSession(FileSystemDatabase fsd, Shovel.Instruction[] bytecode, string program) { var session = new Session (); session.Id = fsd.GetFreshId (); session.ShovelVmSources = program; session.ShovelVmBytecode = Shovel.Api.SerializeBytecode (bytecode); return session; }
private void InitContents(BarrelType type) { Item item = null; byte count = (byte)Utility.RandomMinMax(10, 30); for (byte i = 0; i < count; i++) { switch (type) { default: case BarrelType.Arrows: item = new Arrow(Utility.RandomMinMax(2, 6)); break; case BarrelType.Bolts: item = new Bolt(Utility.RandomMinMax(2, 6)); break; case BarrelType.Farming: { if (i > 3) { return; } switch (Utility.Random(3)) { case 0: item = new Shovel(); break; case 1: item = new Scythe(); break; case 2: item = new Pitchfork(); break; } break; } case BarrelType.LargeMining: { if (i > 5) { return; } switch (Utility.Random(5)) { case 0: item = new Pitchfork(); break; case 1: case 2: item = new Shovel(); break; case 3: case 4: item = new Pickaxe(); break; } break; } case BarrelType.LargeWeapon1: case BarrelType.LargeWeapon2: case BarrelType.LargeWeapon3: { if (i > 6) { return; } switch (Utility.Random(6)) { case 0: item = new Spear(); break; case 1: item = new Halberd(); break; case 2: item = new Axe(); break; case 3: item = new ThinLongsword(); break; case 4: item = new WarAxe(); break; case 5: item = new VikingSword(); break; } break; } case BarrelType.Mining: { if (i > 3) { return; } item = new Pickaxe(); break; } case BarrelType.Spears: { if (i > 4) { return; } item = new Spear(); break; } case BarrelType.Weapons: { if (i > 3) { return; } switch (Utility.Random(3)) { case 0: item = new WarAxe(); break; case 1: item = new WarMace(); break; case 2: item = new Maul(); break; } break; } } if (item != null) { DropItem(item); } } }
public Shovel(Shovel s) : base(s) { }
// Creates the initial game state - this will probably be a huge method at the end of it.. TODO: find way to dynamically create items/npc/etc and place them in appropriate region public void CreateNewGame() { //TEMPORARY NEED TO CREATE SOME SORT OF GAME SETUP / REGION SETUP that is easily scalable List <Sprite> giannaLandTiles = BoundingBoxLocations.RegionMap["Gianna"].RegionLandTiles; List <Sprite> scLandTiles = BoundingBoxLocations.RegionMap["SnooCat"].RegionLandTiles; List <Sprite> usoppLandTiles = BoundingBoxLocations.RegionMap["Usopp"].RegionLandTiles; var screenCenter = new Vector2(_graphics.Viewport.Bounds.Width / 2, _graphics.Viewport.Bounds.Height / 2); ShortShip shortShip = new ShortShip(TeamType.Player, "GustoMap", new Vector2(-100, -600), _content, _graphics); shortShip.shipInterior.interiorId = Guid.NewGuid(); BoundingBoxLocations.interiorMap.Add(shortShip.shipInterior.interiorId, shortShip.shipInterior); BaseShip baseShip = new BaseShip(TeamType.Player, "GustoMap", new Vector2(-300, -600), _content, _graphics); baseShip.shipInterior.interiorId = Guid.NewGuid(); BoundingBoxLocations.interiorMap.Add(baseShip.shipInterior.interiorId, baseShip.shipInterior); BaseShip baseShipAI = new BaseShip(TeamType.A, "Usopp", new Vector2(500, -140), _content, _graphics); baseShipAI.shipInterior.interiorId = Guid.NewGuid(); BoundingBoxLocations.interiorMap.Add(baseShipAI.shipInterior.interiorId, baseShipAI.shipInterior); TeePee teePee = new TeePee(TeamType.A, "Gianna", new Vector2(340, -850), _content, _graphics); teePee.structureInterior.interiorId = Guid.NewGuid(); BoundingBoxLocations.interiorMap.Add(teePee.structureInterior.interiorId, teePee.structureInterior); BaseTribal baseTribalLand = new BaseTribal(TeamType.A, "Gianna", giannaLandTiles[RandomEvents.rand.Next(giannaLandTiles.Count)].location, _content, _graphics); BaseCat baseCatLand = new BaseCat(TeamType.B, "SnooCat", scLandTiles[RandomEvents.rand.Next(scLandTiles.Count)].location, _content, _graphics); Chicken chickenLand = new Chicken(TeamType.Animal, "Gianna", giannaLandTiles[RandomEvents.rand.Next(giannaLandTiles.Count)].location, _content, _graphics); Snake snakeLand = new Snake(TeamType.Animal, "Usopp", usoppLandTiles[RandomEvents.rand.Next(usoppLandTiles.Count)].location, _content, _graphics); BlueBird blueBird = new BlueBird(TeamType.Animal, "Usopp", usoppLandTiles[RandomEvents.rand.Next(usoppLandTiles.Count)].location, _content, _graphics); Tower tower = new BaseTower(TeamType.B, "GustoMap", new Vector2(-1600, -1500), _content, _graphics); ClayFurnace furnace = new ClayFurnace(TeamType.Player, "GustoMap", new Vector2(180, 140), _content, _graphics); CraftingAnvil craftingAnvil = new CraftingAnvil(TeamType.Player, "GustoMap", new Vector2(120, 40), _content, _graphics); BaseBarrel barrelLand = new BaseBarrel(TeamType.A, "GustoMap", new Vector2(-20, -160), _content, _graphics); BaseBarrel barrelOcean = new BaseBarrel(TeamType.A, "GustoMap", new Vector2(380, -90), _content, _graphics); BaseChest chestLand = new BaseChest(TeamType.A, "GustoMap", new Vector2(100, -120), _content, _graphics); CampFire campfire = new CampFire(TeamType.A, "GustoMap", new Vector2(70, -350), _content, _graphics); Shovel shovel = new Shovel(TeamType.A, "GustoMap", new Vector2(200, -330), _content, _graphics); shovel.onGround = true; Pickaxe pickaxe = new Pickaxe(TeamType.Player, "GustoMap", new Vector2(130, -430), _content, _graphics); pickaxe.onGround = true; //Pistol pistol = new Pistol(TeamType.A, "GustoMap", new Vector2(250, -300), _content, _graphics); //pistol.amountStacked = 1; //pistol.onGround = true; BaseCannon cannon = new BaseCannon(TeamType.A, "GustoMap", new Vector2(0, -450), _content, _graphics); cannon.onGround = true; Ballista ballista = new Ballista(TeamType.A, "GustoMap", new Vector2(-120, -550), _content, _graphics); ballista.onGround = true; CrossBow crossBow = new CrossBow(TeamType.A, "GustoMap", new Vector2(220, -350), _content, _graphics); crossBow.amountStacked = 1; crossBow.onGround = true; ArrowItem arrows = new ArrowItem(TeamType.A, "GustoMap", new Vector2(210, -340), _content, _graphics); arrows.onGround = true; arrows.amountStacked = 10; //PistolShotItem pistolAmmo = new PistolShotItem(TeamType.A, "GustoMap", new Vector2(220, -300), _content, _graphics); //pistolAmmo.amountStacked = 14; //pistolAmmo.onGround = true; CannonBallItem cannonAmmo = new CannonBallItem(TeamType.A, "GustoMap", new Vector2(200, -300), _content, _graphics); cannonAmmo.amountStacked = 10; cannonAmmo.onGround = true; RustyHarpoonItem harpoonAmmo = new RustyHarpoonItem(TeamType.A, "GustoMap", new Vector2(-120, -550), _content, _graphics); harpoonAmmo.amountStacked = 10; harpoonAmmo.onGround = true; Lantern lantern = new Lantern(TeamType.A, "GustoMap", new Vector2(180, -300), _content, _graphics); lantern.onGround = true; BasePlank basePlank = new BasePlank(TeamType.A, "GustoMap", new Vector2(150, -300), _content, _graphics); basePlank.onGround = true; basePlank.amountStacked = 10; // Item utility is global and is accessed in main update, all items that are "dropped" or placed on the world view ground exist in this list (placable, invetory, etc) ItemUtility.ItemsToUpdate.Add(lantern); ItemUtility.ItemsToUpdate.Add(furnace); ItemUtility.ItemsToUpdate.Add(craftingAnvil); ItemUtility.ItemsToUpdate.Add(barrelLand); ItemUtility.ItemsToUpdate.Add(barrelOcean); ItemUtility.ItemsToUpdate.Add(chestLand); ItemUtility.ItemsToUpdate.Add(shovel); //ItemUtility.ItemsToUpdate.Add(pistol); ItemUtility.ItemsToUpdate.Add(cannon); ItemUtility.ItemsToUpdate.Add(ballista); ItemUtility.ItemsToUpdate.Add(crossBow); ItemUtility.ItemsToUpdate.Add(arrows); ItemUtility.ItemsToUpdate.Add(pickaxe); //ItemUtility.ItemsToUpdate.Add(pistolAmmo); ItemUtility.ItemsToUpdate.Add(cannonAmmo); ItemUtility.ItemsToUpdate.Add(harpoonAmmo); ItemUtility.ItemsToUpdate.Add(basePlank); ItemUtility.ItemsToUpdate.Add(campfire); UpdateOrder.Add(shortShip); UpdateOrder.Add(baseShip); UpdateOrder.Add(baseShipAI); UpdateOrder.Add(player); UpdateOrder.Add(baseTribalLand); UpdateOrder.Add(baseCatLand); UpdateOrder.Add(chickenLand); UpdateOrder.Add(blueBird); UpdateOrder.Add(snakeLand); UpdateOrder.Add(tower); UpdateOrder.Add(teePee); // interior set BaseTribal baseTribalInShip = new BaseTribal(TeamType.A, "GustoMap", Vector2.Zero, _content, _graphics); baseTribalInShip.npcInInterior = baseShipAI.shipInterior; baseShipAI.shipInterior.interiorObjects.Add(baseTribalInShip); ready = true; }
void Is123(Shovel.Value result) { Assert.IsTrue (result.Kind == Shovel.Value.Kinds.Array); Assert.AreEqual (3, result.ArrayValue.Count); Assert.AreEqual (1, result.ArrayValue [0].IntegerValue); Assert.AreEqual (2, result.ArrayValue [1].IntegerValue); Assert.AreEqual (3, result.ArrayValue [2].IntegerValue); }
public static Exception VmUserDefinedPrimitiveError(Shovel.Vm.Vm vm) { return vm.UserDefinedPrimitiveError; }
public static ShovelException VmProgrammingError(Shovel.Vm.Vm vm) { return vm.ProgrammingError; }
public static Value TestRunVm(Shovel.Instruction[] bytecode, List<SourceFile> sources) { var vm = Vm.Vm.RunVm (bytecode, sources); return vm.CheckStackTop (); }
public static Vm.Vm RunVm( Shovel.Instruction[] bytecode, List<SourceFile> sources, IEnumerable<Callable> userPrimitives = null, byte[] state = null, int? totalTicksQuota = null, int? ticksUntilNextNapQuota = null, int? usedCellsQuota = null) { return Vm.Vm.RunVm ( bytecode, sources, userPrimitives, state, null, usedCellsQuota, totalTicksQuota, ticksUntilNextNapQuota); }
public override void OnThink() { if (this.Alive && this.m_Mine && this.m_NextUse <= DateTime.Now) { Container backpack = this.Backpack; if (backpack == null) { m_NextUse = DateTime.Now + TimeSpan.FromSeconds(2.5); base.OnThink(); return; } if (backpack.TotalWeight > (backpack.MaxWeight - 100)) { this.Say("I'm full !! I'm AutoConverting Ore in Ingot !"); m_Mine = true; this.Hue = 0; ControlOrder = OrderType.Stay; ConvertOretoIngot(this); base.OnThink(); return; } Shovel shovel1 = (Shovel)backpack.FindItemByType(typeof(Shovel)); Pickaxe shovel2 = (Pickaxe)backpack.FindItemByType(typeof(Pickaxe)); IBShovel shovel3 = (IBShovel)backpack.FindItemByType(typeof(IBShovel)); if (shovel1 != null) { if (this.DoDisposeOre(this.X, this.Y, this.Z, this.Map, this)) { shovel1.UsesRemaining -= 1; if (shovel1 != null && !shovel1.Deleted && shovel1.UsesRemaining <= 0) { shovel1.Delete(); } } } if (shovel2 != null) { if (this.DoDisposeOre(this.X, this.Y, this.Z, this.Map, this)) { shovel2.UsesRemaining -= 1; if (shovel2 != null && !shovel2.Deleted && shovel2.UsesRemaining <= 0) { shovel2.Delete(); } } } if (shovel3 != null) { if (this.DoDisposeOre(this.X, this.Y, this.Z, this.Map, this)) { shovel3.UsesRemaining -= 1; if (shovel3 != null && !shovel3.Deleted && shovel3.UsesRemaining <= 0) { shovel3.Delete(); } } } m_NextUse = DateTime.Now + TimeSpan.FromSeconds(2.5); if ((shovel1 == null) && (shovel2 == null) && (shovel3 == null)) { this.Say("I require a tool to dig"); m_Mine = false; this.Hue = 0; ControlOrder = OrderType.Follow; } IronIngot iron1 = (IronIngot)backpack.FindItemByType(typeof(IronIngot)); if (iron1 is BaseIngot) { BaseIngot m_Ore1 = iron1 as BaseIngot; if (m_Ore1.Amount > 1000) { SendIronIngot(this); } } DullcopperIngot dull1 = (DullcopperIngot)backpack.FindItemByType(typeof(DullcopperIngot)); if (dull1 is BaseIngot) { BaseIngot m_Ore2 = dull1 as BaseIngot; if (m_Ore2.Amount > 1000) { SendDullCopperIngot(this); } } ShadowIngot shad1 = (ShadowIngot)backpack.FindItemByType(typeof(ShadowIngot)); if (shad1 is BaseIngot) { BaseIngot m_Ore3 = shad1 as BaseIngot; if (m_Ore3.Amount > 1000) { SendShadowIronIngot(this); } } BronzeIngot bron1 = (BronzeIngot)backpack.FindItemByType(typeof(BronzeIngot)); if (bron1 is BaseIngot) { BaseIngot m_Ore4 = bron1 as BaseIngot; if (m_Ore4.Amount > 1000) { SendBronzeIngot(this); } } GoldIngot gold1 = (GoldIngot)backpack.FindItemByType(typeof(GoldIngot)); if (gold1 is BaseIngot) { BaseIngot m_Ore5 = gold1 as BaseIngot; if (m_Ore5.Amount > 1000) { SendGoldIngot(this); } } CopperIngot copp1 = (CopperIngot)backpack.FindItemByType(typeof(CopperIngot)); if (copp1 is BaseIngot) { BaseIngot m_Ore6 = copp1 as BaseIngot; if (m_Ore6.Amount > 1000) { SendCopperIngot(this); } } AgapiteIngot agap1 = (AgapiteIngot)backpack.FindItemByType(typeof(AgapiteIngot)); if (agap1 is BaseIngot) { BaseIngot m_Ore7 = agap1 as BaseIngot; if (m_Ore7.Amount > 1000) { SendAgapiteIngot(this); } } VeriteIngot veri1 = (VeriteIngot)backpack.FindItemByType(typeof(VeriteIngot)); if (veri1 is BaseIngot) { BaseIngot m_Ore8 = veri1 as BaseIngot; if (m_Ore8.Amount > 1000) { SendVeriteIngot(this); } } ValoriteIngot valo1 = (ValoriteIngot)backpack.FindItemByType(typeof(ValoriteIngot)); if (valo1 is BaseIngot) { BaseIngot m_Ore9 = valo1 as BaseIngot; if (m_Ore9.Amount > 1000) { SendValoriteIngot(this); } } } base.OnThink(); }
public void Setup(Shovel shovel) { this.shovel = shovel; }
// Start is called before the first frame update void Start() { shovel = GetComponentInChildren <Shovel>(); currentHealth = maxHealth; }
/// <summary> /// Activate and settp the info window /// </summary> /// <param name="shovel">active shovel</param> private void ShowShovelInfoWindow(Shovel shovel) { shovelInfoWindow.SetActive(true); shovelInfoWindow.GetComponent <ShovelInfo>().Setup(shovel); TweenEffect(); }
private void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { //check for each item available and add. //itemtype references the item array found under the inventoryScript //gameobject. //check if full so we can add the items if (InventoryScript.MyInstance.MyEmptySlotCount > 0) { if (itemType == "Leaflet") { Leaflet leaflet = (Leaflet)Instantiate(InventoryScript.MyInstance.items[1]); InventoryScript.MyInstance.AddItem(leaflet); } else if (itemType == "Egg") { Egg egg = (Egg)Instantiate(InventoryScript.MyInstance.items[2]); InventoryScript.MyInstance.AddItem(egg); } else if (itemType == "Sword") { Sword sword = (Sword)Instantiate(InventoryScript.MyInstance.items[3]); InventoryScript.MyInstance.AddItem(sword); } else if (itemType == "Trident") { Trident trident = (Trident)Instantiate(InventoryScript.MyInstance.items[4]); InventoryScript.MyInstance.AddItem(trident); } else if (itemType == "Airpump") { AirPump ap = (AirPump)Instantiate(InventoryScript.MyInstance.items[5]); InventoryScript.MyInstance.AddItem(ap); } else if (itemType == "Bar") { PlatinumBar bar = (PlatinumBar)Instantiate(InventoryScript.MyInstance.items[6]); InventoryScript.MyInstance.AddItem(bar); } else if (itemType == "Knife") { Knife knife = (Knife)Instantiate(InventoryScript.MyInstance.items[7]); InventoryScript.MyInstance.AddItem(knife); } else if (itemType == "Rope") { Rope rope = (Rope)Instantiate(InventoryScript.MyInstance.items[8]); InventoryScript.MyInstance.AddItem(rope); } else if (itemType == "Skull") { Skull skull = (Skull)Instantiate(InventoryScript.MyInstance.items[9]); InventoryScript.MyInstance.AddItem(skull); } else if (itemType == "Sack") { Sack sack = (Sack)Instantiate(InventoryScript.MyInstance.items[10]); InventoryScript.MyInstance.AddItem(sack); } else if (itemType == "Lantern") { Lantern lantern = (Lantern)Instantiate(InventoryScript.MyInstance.items[11]); InventoryScript.MyInstance.AddItem(lantern); } else if (itemType == "Bottle") { Bottle bottle = (Bottle)Instantiate(InventoryScript.MyInstance.items[12]); InventoryScript.MyInstance.AddItem(bottle); } else if (itemType == "Candle") { Candle candle = (Candle)Instantiate(InventoryScript.MyInstance.items[13]); InventoryScript.MyInstance.AddItem(candle); } else if (itemType == "BlackBook") { BlkBook book = (BlkBook)Instantiate(InventoryScript.MyInstance.items[14]); InventoryScript.MyInstance.AddItem(book); } else if (itemType == "PlasticPile") { PlasticPile plastic = (PlasticPile)Instantiate(InventoryScript.MyInstance.items[15]); InventoryScript.MyInstance.AddItem(plastic); } else if (itemType == "Buoy") { Buoy buoy = (Buoy)Instantiate(InventoryScript.MyInstance.items[16]); InventoryScript.MyInstance.AddItem(buoy); } else if (itemType == "Shovel") { Shovel shovel = (Shovel)Instantiate(InventoryScript.MyInstance.items[17]); InventoryScript.MyInstance.AddItem(shovel); } else if (itemType == "Scarab") { Scarab scarab = (Scarab)Instantiate(InventoryScript.MyInstance.items[18]); InventoryScript.MyInstance.AddItem(scarab); } else if (itemType == "PotOfGold") { PotOfGold gold = (PotOfGold)Instantiate(InventoryScript.MyInstance.items[19]); InventoryScript.MyInstance.AddItem(gold); } else if (itemType == "Bracelet") { Bracelet bracelet = (Bracelet)Instantiate(InventoryScript.MyInstance.items[20]); InventoryScript.MyInstance.AddItem(bracelet); } else if (itemType == "Coal") { Coal coal = (Coal)Instantiate(InventoryScript.MyInstance.items[21]); InventoryScript.MyInstance.AddItem(coal); } else if (itemType == "Figurine") { Figurine fig = (Figurine)Instantiate(InventoryScript.MyInstance.items[22]); InventoryScript.MyInstance.AddItem(fig); } else if (itemType == "Diamond") { Diamond diamond = (Diamond)Instantiate(InventoryScript.MyInstance.items[23]); InventoryScript.MyInstance.AddItem(diamond); } else if (itemType == "Torch") { Torch torch = (Torch)Instantiate(InventoryScript.MyInstance.items[24]); InventoryScript.MyInstance.AddItem(torch); } else if (itemType == "Coins") { Coins coins = (Coins)Instantiate(InventoryScript.MyInstance.items[25]); InventoryScript.MyInstance.AddItem(coins); } else if (itemType == "Key") { Key key = (Key)Instantiate(InventoryScript.MyInstance.items[26]); InventoryScript.MyInstance.AddItem(key); } else if (itemType == "Matches") { Matches matches = (Matches)Instantiate(InventoryScript.MyInstance.items[27]); InventoryScript.MyInstance.AddItem(matches); } else if (itemType == "Wrench") { Wrench wrench = (Wrench)Instantiate(InventoryScript.MyInstance.items[28]); InventoryScript.MyInstance.AddItem(wrench); } else if (itemType == "Screwdriver") { Screwdriver sd = (Screwdriver)Instantiate(InventoryScript.MyInstance.items[29]); InventoryScript.MyInstance.AddItem(sd); } else if (itemType == "Jewels") { Jewels jewels = (Jewels)Instantiate(InventoryScript.MyInstance.items[30]); InventoryScript.MyInstance.AddItem(jewels); } else if (itemType == "Coffin") { Coffin coffin = (Coffin)Instantiate(InventoryScript.MyInstance.items[31]); InventoryScript.MyInstance.AddItem(coffin); } else if (itemType == "Chalice") { Chalice chalice = (Chalice)Instantiate(InventoryScript.MyInstance.items[32]); InventoryScript.MyInstance.AddItem(chalice); } //the following items should not be displayed in the world //but going to add just in case we revamp how these items //are obtained. else if(itemType == "Garlic") { Garlic garlic = (Garlic)Instantiate(InventoryScript.MyInstance.items[33]); InventoryScript.MyInstance.AddItem(garlic); } else if(itemType == "Sceptre") { Sceptre sep = (Sceptre)Instantiate(InventoryScript.MyInstance.items[34]); InventoryScript.MyInstance.AddItem(sep); } Destroy(gameObject); } //probably want to utilize CLI popup here else { Debug.Log("Bag full"); } } }