mirror of
https://github.com/YouHaveTrouble/YHTMod.git
synced 2026-05-11 21:56:54 +00:00
Hello world
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace YHTMod.Projectiles.Weapons;
|
||||
|
||||
class CopperSwordOnAStickProjectile : ModProjectile {
|
||||
public override void SetDefaults() {
|
||||
Projectile.width = 80;
|
||||
Projectile.height = 80;
|
||||
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.DamageType = DamageClass.Melee;
|
||||
Projectile.ownerHitCheck = true;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.timeLeft = 300;
|
||||
Projectile.aiStyle = ProjAIStyleID.ShortSword;
|
||||
}
|
||||
|
||||
public override void AI() {
|
||||
base.AI();
|
||||
float random = (float) (Random.Shared.NextDouble() / 5f);
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2 - MathHelper.PiOver4 * Projectile.spriteDirection;
|
||||
Projectile.rotation += random;
|
||||
DrawOriginOffsetX = 0;
|
||||
DrawOffsetX = 0;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,31 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace YHTMod.Projectiles.Weapons;
|
||||
|
||||
class MithrilPebbleOfPigSmitingProjectile : ModProjectile {
|
||||
public override void SetDefaults() {
|
||||
Projectile.width = 8;
|
||||
Projectile.height = 8;
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.tileCollide = true;
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
Projectile.ownerHitCheck = true;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.timeLeft = 300;
|
||||
Projectile.aiStyle = ProjAIStyleID.ThrownProjectile;
|
||||
Projectile.light = 0.3f;
|
||||
}
|
||||
|
||||
public override void AI() {
|
||||
base.AI();
|
||||
DrawOriginOffsetX = 0;
|
||||
DrawOffsetX = 0;
|
||||
int dust = Dust.NewDust(Projectile.Center, 1, 1, DustID.Mythril, 0f, 0f, 0, default(Color), 1f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 0.3f;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 562 B |
Reference in New Issue
Block a user