Skip to content

Commit

Permalink
v1.6.3
Browse files Browse the repository at this point in the history
* Updated for TML 0.10
* Offloaded utility/helper code to Hamstar's Helpers mod (now a dependency)
* Numerous fixes and tweaks
  • Loading branch information
hamstar committed Jun 8, 2017
1 parent 5fbe23c commit 25c3bac
Show file tree
Hide file tree
Showing 20 changed files with 115 additions and 456 deletions.
27 changes: 15 additions & 12 deletions Items/ChaosBombItem.cs
Expand Up @@ -6,8 +6,13 @@

namespace Wormholes.Items {
class ChaosBombItem : ModItem {
public override void SetStaticDefaults() {
this.DisplayName.SetDefault( "Chaos Bomb" );
this.Tooltip.SetDefault( "Randomly scatters blocks within blast radius"+'\n'+
"20% chance to permanently relocate a wormholes" );
}

public override void SetDefaults() {
this.item.name = "Chaos Bomb";
this.item.useStyle = 1;
this.item.shootSpeed = 5f;
this.item.shoot = this.mod.ProjectileType<ChaosBombProjectile>();
Expand All @@ -21,8 +26,6 @@ class ChaosBombItem : ModItem {
this.item.noUseGraphic = true;
this.item.noMelee = true;
this.item.damage = 0;
this.item.toolTip = "Randomly scatters blocks within blast radius";
this.item.toolTip2 = "20% chance to permanently relocate a wormholes";
this.item.value = Item.buyPrice( 0, 0, 20, 0 );
this.item.rare = 1;
}
Expand All @@ -39,16 +42,16 @@ class ChaosBombRecipe : ModRecipe {
public ChaosBombRecipe( ChaosBombItem moditem ) : base( moditem.mod ) {
this.AddTile( 18 ); // Crafting bench

this.AddIngredient( "Bouncy Bomb", 5 );
this.AddRecipeGroup( "WormholesMod:EvacPotions", 1 );
this.AddIngredient( "Amethyst", 1 );
this.AddIngredient( "Topaz", 1 );
this.AddIngredient( "Sapphire", 1 );
this.AddIngredient( "Emerald", 1 );
this.AddIngredient( "Ruby", 1 );
this.AddIngredient( "Diamond", 1 );
this.AddIngredient( "Amber", 1 );
//this.AddIngredient( "Glass", 10 );
this.AddIngredient( ItemID.BouncyBomb, 5 );
this.AddIngredient( ItemID.Amethyst, 1 );
this.AddIngredient( ItemID.Topaz, 1 );
this.AddIngredient( ItemID.Sapphire, 1 );
this.AddIngredient( ItemID.Emerald, 1 );
this.AddIngredient( ItemID.Ruby, 1 );
this.AddIngredient( ItemID.Diamond, 1 );
this.AddIngredient( ItemID.Amber, 1 );
//this.AddIngredient( ItemID.Glass, 10 );
this.SetResult( moditem, 5 );
}

Expand Down
35 changes: 19 additions & 16 deletions Items/TownPortalScrollItem.cs
@@ -1,8 +1,8 @@
using Microsoft.Xna.Framework;
using HamstarHelpers.PlayerHelpers;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Utils;


namespace Wormholes.Items {
Expand All @@ -21,8 +21,13 @@ class TownPortalScrollItem : ModItem {
}


public override void SetStaticDefaults() {
this.DisplayName.SetDefault( "Scroll of Town Portal" );
this.Tooltip.SetDefault( "Creates a temporary portal between here and home"+'\n'+
"Still no cow level." );
}

public override void SetDefaults() {
this.item.name = "Scroll of Town Portal";
this.item.UseSound = SoundID.Item46;
this.item.useTurn = true;
this.item.useStyle = 4;
Expand All @@ -32,8 +37,6 @@ class TownPortalScrollItem : ModItem {
this.item.consumable = true;
this.item.width = 35;
this.item.height = 14;
this.item.toolTip = "Creates a temporary portal between here and home";
this.item.toolTip2 = "Still no cow level.";
this.item.value = 10000;
this.item.rare = 1;
}
Expand All @@ -48,7 +51,7 @@ class TownPortalScrollItem : ModItem {

public override bool ConsumeItem( Player player ) {
var player_pos = player.Center;
var home_pos = PlayerHelper.GetSpawnPoint( player );
var home_pos = PlayerHelpers.GetSpawnPoint( player );
player_pos.X -= WormholePortal.Width / 2;
player_pos.Y -= 128 + player.height + 1;
home_pos.X -= WormholePortal.Width / 2;
Expand All @@ -62,18 +65,18 @@ class TownPortalScrollItem : ModItem {
public override void AddRecipes() {
ModRecipe recipe = new TownPortalScrollRecipe( this );
recipe.AddRecipe();

/*ModRecipe alt_wormhole_pot = new ModRecipe( this.mod );
alt_wormhole_pot.AddIngredient( "Recall Potion", 1 );
alt_wormhole_pot.AddIngredient( "Blinkroot", 1 );
alt_wormhole_pot.SetResult( "Wormhole Potion" );
alt_wormhole_pot.AddIngredient( ItemID.RecallPotion, 1 );
alt_wormhole_pot.AddIngredient( ItemID.Blinkroot, 1 );
alt_wormhole_pot.SetResult( ItemID.WormholePotion" );
alt_wormhole_pot.AddTile( 13 ); // Bottle
alt_wormhole_pot.AddRecipe();
ModRecipe alt_recall_pot = new ModRecipe( this.mod );
alt_recall_pot.AddIngredient( "Wormhole Potion", 1 );
alt_recall_pot.AddIngredient( "Daybloom", 1 );
alt_recall_pot.SetResult( "Recall Potion" );
alt_recall_pot.AddIngredient( ItemID.WormholePotion, 1 );
alt_recall_pot.AddIngredient( ItemID.Daybloom, 1 );
alt_recall_pot.SetResult( ItemID.RecallPotion );
alt_recall_pot.AddTile( 13 ); // Bottle
alt_recall_pot.AddRecipe();*/
}
Expand All @@ -85,10 +88,10 @@ class TownPortalScrollRecipe : ModRecipe {
public TownPortalScrollRecipe( TownPortalScrollItem moditem ) : base( moditem.mod ) {
this.AddTile( 18 ); // Crafting bench

this.AddIngredient( "Book", 1 );
this.AddRecipeGroup( "WormholesMod:EvacPotions", 1 );
//this.AddIngredient( "Wormhole Potion", 1 );
this.AddIngredient( "Mana Crystal", 1 );
this.AddIngredient( ItemID.Book, 1 );
//this.AddIngredient( ItemID.WormholePotion, 1 );
this.AddIngredient( ItemID.ManaCrystal, 1 );
this.SetResult( moditem, 1 );
}

Expand Down
24 changes: 15 additions & 9 deletions Projectiles/ChaosBombProjectile.cs
@@ -1,16 +1,19 @@
using Microsoft.Xna.Framework;
using HamstarHelpers.TileHelpers;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
using Utils;


namespace Wormholes.Projectiles {
public class ChaosBombProjectile : ModProjectile {
public override void SetStaticDefaults() {
this.DisplayName.SetDefault( "Chaos Bomb" );
}

public override void SetDefaults() {
this.projectile.name = "Chaos Bomb";
this.projectile.width = 22;
this.projectile.height = 22;
this.projectile.aiStyle = 16;
Expand Down Expand Up @@ -126,7 +129,7 @@ public class ChaosBombProjectile : ModProjectile {
this.ScatterTiles( tile_x, tile_y, radius, mymod.Config.Data.ChaosBombScatterRadius );

if( Main.netMode != 0 ) {
NetMessage.SendData( MessageID.KillProjectile, -1, -1, "", proj.identity, (float)proj.owner, 0f, 0f, 0, 0, 0 );
NetMessage.SendData( MessageID.KillProjectile, -1, -1, null, proj.identity, (float)proj.owner, 0f, 0f, 0, 0, 0 );
}
}
}
Expand All @@ -143,13 +146,16 @@ public class ChaosBombProjectile : ModProjectile {
if( Math.Sqrt( (x_dist*x_dist)+(y_dist*y_dist) ) > radius ) { continue; } // Crude

fro_tile = Main.tile[i, j];
if( fro_tile == null || TileHelper.IsNonBlocking(fro_tile, true, false, false, true, true, true) ) { continue; }
if( TileHelper.IsNotBombable(i, j) ) { continue; }
if( fro_tile == null ) { continue; }
if( TileHelpers.IsSolid( fro_tile, true, true ) ) { continue; }
if( TileHelpers.IsWire( fro_tile ) ) { continue; }
if( fro_tile.lava() ) { continue; }
if( TileHelpers.IsNotBombable(i, j) ) { continue; }

var tile_data = TileObjectData.GetTileData( fro_tile );
if( tile_data != null && (tile_data.Width > 1 || tile_data.Height > 1) ) { continue; }

if( !TileHelper.FindNearbyRandomAirTile( tile_x, tile_y, scatter_radius, out to_x, out to_y ) ) {
if( !TileHelpers.FindNearbyRandomAirTile( tile_x, tile_y, scatter_radius, out to_x, out to_y ) ) {
break;
}

Expand All @@ -164,10 +170,10 @@ public class ChaosBombProjectile : ModProjectile {

if( Main.netMode != 0 ) {
if( !Main.tile[i, j].active() ) {
NetMessage.SendData( MessageID.TileChange, -1, -1, "", 0, (float)i, (float)j, 0f, 0, 0, 0 );
NetMessage.SendData( MessageID.TileChange, -1, -1, null, 0, (float)i, (float)j, 0f, 0, 0, 0 );
}
if( !Main.tile[to_x, to_y].active() ) {
NetMessage.SendData( MessageID.TileChange, -1, -1, "", 0, (float)to_x, (float)to_y, 0f, 0, 0, 0 );
NetMessage.SendData( MessageID.TileChange, -1, -1, null, 0, (float)to_x, (float)to_y, 0f, 0, 0, 0 );
}
}

Expand Down
44 changes: 0 additions & 44 deletions Utils/DebugHelper.cs

This file was deleted.

10 changes: 0 additions & 10 deletions Utils/DustHelper.cs

This file was deleted.

87 changes: 0 additions & 87 deletions Utils/JsonConfig.cs

This file was deleted.

39 changes: 0 additions & 39 deletions Utils/PlayerHelper.cs

This file was deleted.

0 comments on commit 25c3bac

Please sign in to comment.