-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implemented ProjectilesAsConsecutiveHittingAndCooldown setting (untested) * Added assurance of projectiles hitting at least 1 tile in OnTileCollide * Restructured some projectile code
- Loading branch information
hamstar0
committed
Jun 1, 2019
1 parent
699e91b
commit 13b29b9
Showing
5 changed files
with
101 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using DestructibleTiles.Helpers.CollisionHelpers; | ||
using DestructibleTiles.Helpers.TileHelpers; | ||
using HamstarHelpers.Helpers.DebugHelpers; | ||
using HamstarHelpers.Helpers.ProjectileHelpers; | ||
using HamstarHelpers.Services.Timers; | ||
using Microsoft.Xna.Framework; | ||
using Terraria; | ||
using Terraria.ModLoader; | ||
|
||
|
||
namespace DestructibleTiles { | ||
partial class DestructibleTilesProjectile : GlobalProjectile { | ||
public static IDictionary<string, Tuple<int, int>> GetExplosives() { | ||
var projectiles = new Dictionary<string, Tuple<int, int>>(); | ||
|
||
for( int i = 0; i < Main.projectileTexture.Length; i++ ) { | ||
var proj = new Projectile(); | ||
Main.projectile[0] = proj; | ||
|
||
try { | ||
proj.SetDefaults( i ); | ||
|
||
if( proj.aiStyle == 16 ) { | ||
int damage = proj.damage; | ||
|
||
proj.position = new Vector2( 3000, 1000 ); | ||
proj.owner = Main.myPlayer; | ||
proj.hostile = true; | ||
|
||
proj.timeLeft = 3; | ||
proj.VanillaAI(); | ||
|
||
int radius = ( proj.width + proj.height ) / 4; | ||
damage = damage > proj.damage ? damage : proj.damage; | ||
|
||
string projName = ProjectileIdentityHelpers.GetProperUniqueId( i ); | ||
projectiles[projName] = Tuple.Create( radius, damage ); | ||
} | ||
} catch { | ||
continue; | ||
} | ||
} | ||
|
||
Main.projectile[0] = new Projectile(); | ||
|
||
return projectiles; | ||
} | ||
} | ||
} |