Merge branch 'master' of https://github.com/CalamityTeam/CalamityMod
This commit is contained in:
commit
da4b2eae9b
13 files changed
+198
-6
No files matched your search
@@ -0,0 +1,24 @@
|
||||
using CalamityMod.Items.Mounts;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Mounts
|
||||
{
|
||||
public class DraedonGamerChairBuff : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Exo Chair");
|
||||
Description.SetDefault("Riding a physics defying gamer chair");
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.mount.SetMount(ModContent.MountType<DraedonGamerChairMount>(), player);
|
||||
player.buffTime[buffIndex] = 10;
|
||||
player.Calamity().ExoChair = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 757 B |
@@ -326,6 +326,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool angryDog = false;
|
||||
public bool fab = false;
|
||||
public bool crysthamyr = false;
|
||||
public bool ExoChair = false;
|
||||
public AndromedaPlayerState andromedaState;
|
||||
public int andromedaCripple;
|
||||
public const float UnicornSpeedNerfPower = 0.8f;
|
||||
@@ -1529,6 +1530,7 @@ namespace CalamityMod.CalPlayer
|
||||
angryDog = false;
|
||||
fab = false;
|
||||
crysthamyr = false;
|
||||
ExoChair = false;
|
||||
miniOldDuke = false;
|
||||
|
||||
abyssalDivingSuitPlates = false;
|
||||
@@ -2296,6 +2298,7 @@ namespace CalamityMod.CalPlayer
|
||||
angryDog = false;
|
||||
fab = false;
|
||||
crysthamyr = false;
|
||||
ExoChair = false;
|
||||
abyssalDivingSuitPlates = false;
|
||||
sirenWaterBuff = false;
|
||||
sirenIce = false;
|
||||
@@ -3929,6 +3932,47 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PreUpdateMovement
|
||||
public override void PreUpdateMovement()
|
||||
{
|
||||
// Remove acceleration when using the exo chair.
|
||||
if (ExoChair)
|
||||
{
|
||||
float speed = DraedonGamerChairMount.MovementSpeed;
|
||||
if (CalamityMod.ExoChairSpeedupHotkey.Current)
|
||||
speed *= 2f;
|
||||
|
||||
if (player.controlLeft)
|
||||
{
|
||||
player.velocity.X = -speed;
|
||||
player.direction = -1;
|
||||
}
|
||||
else if (player.controlRight)
|
||||
{
|
||||
player.velocity.X = speed;
|
||||
player.direction = 1;
|
||||
}
|
||||
else
|
||||
player.velocity.X = 0f;
|
||||
|
||||
if (player.controlUp)
|
||||
player.velocity.Y = -speed;
|
||||
|
||||
else if (player.controlDown)
|
||||
{
|
||||
player.velocity.Y = speed;
|
||||
if (Collision.TileCollision(player.position, player.velocity, player.width, player.height, true, false, (int)player.gravDir).Y == 0f)
|
||||
player.velocity.Y = 0.5f;
|
||||
}
|
||||
else
|
||||
player.velocity.Y = 0f;
|
||||
|
||||
if (player.controlJump)
|
||||
player.velocity *= 0.5f;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PostUpdateBuffs
|
||||
public override void PostUpdateBuffs() => ForceVariousEffects();
|
||||
#endregion
|
||||
|
||||
+3
-1
@@ -84,6 +84,7 @@ namespace CalamityMod
|
||||
public static ModHotKey PlaguePackHotKey;
|
||||
public static ModHotKey AngelicAllianceHotKey;
|
||||
public static ModHotKey GodSlayerDashHotKey;
|
||||
public static ModHotKey ExoChairSpeedupHotkey;
|
||||
|
||||
// Boss Spawners
|
||||
public static int ghostKillCount = 0;
|
||||
@@ -182,8 +183,9 @@ namespace CalamityMod
|
||||
PlaguePackHotKey = RegisterHotKey("Booster Dash", "Q");
|
||||
AngelicAllianceHotKey = RegisterHotKey("Angelic Alliance Blessing", "G");
|
||||
GodSlayerDashHotKey = RegisterHotKey("God Slayer Dash", "H");
|
||||
ExoChairSpeedupHotkey = RegisterHotKey("Exo Chair Speed Up", "LeftShift");
|
||||
|
||||
if (!Main.dedServ)
|
||||
if (!Main.dedServ)
|
||||
LoadClient();
|
||||
|
||||
ILChanges.Load();
|
||||
|
||||
@@ -496,13 +496,12 @@ namespace CalamityMod.ILEditing
|
||||
private static void ManipulateSoundMuffleFactor(ILContext il)
|
||||
{
|
||||
ILCursor cursor = new ILCursor(il);
|
||||
cursor.GotoNext(MoveType.After, i => i.MatchStloc(30));
|
||||
cursor.Index--;
|
||||
cursor.GotoNext(MoveType.Before, i => i.MatchStloc(30));
|
||||
|
||||
cursor.Emit(OpCodes.Ldloc, 20);
|
||||
cursor.EmitDelegate<Func<float, float>>(originalMuffleFactor =>
|
||||
{
|
||||
if (Main.gameMenu)
|
||||
if (Main.gameMenu || !Main.LocalPlayer.active)
|
||||
return originalMuffleFactor;
|
||||
|
||||
float playerMuffleFactor = 1f - Main.LocalPlayer.Calamity().MusicMuffleFactor;
|
||||
@@ -511,8 +510,8 @@ namespace CalamityMod.ILEditing
|
||||
{
|
||||
for (int i = 0; i < Main.music.Length; i++)
|
||||
{
|
||||
if (Main.music[i]?.IsPlaying ?? false)
|
||||
Main.music[i]?.Stop(AudioStopOptions.Immediate);
|
||||
if (Main.music[i] != null && Main.music[i].IsPlaying)
|
||||
Main.music[i].Stop(AudioStopOptions.Immediate);
|
||||
}
|
||||
Main.curMusic = 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
using CalamityMod.Buffs.Mounts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Mounts
|
||||
{
|
||||
public class DraedonGamerChairMount : ModMountData
|
||||
{
|
||||
public const float MovementSpeed = 12f;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
mountData.spawnDust = 182;
|
||||
mountData.spawnDustNoGravity = true;
|
||||
mountData.buff = ModContent.BuffType<DraedonGamerChairBuff>();
|
||||
mountData.heightBoost = 0;
|
||||
mountData.flightTimeMax = int.MaxValue;
|
||||
mountData.fatigueMax = int.MaxValue;
|
||||
mountData.fallDamage = 0f;
|
||||
mountData.usesHover = true;
|
||||
mountData.runSpeed = MovementSpeed;
|
||||
mountData.dashSpeed = MovementSpeed;
|
||||
mountData.acceleration = MovementSpeed;
|
||||
mountData.swimSpeed = MovementSpeed;
|
||||
mountData.jumpHeight = 8;
|
||||
mountData.jumpSpeed = 8f;
|
||||
mountData.blockExtraJumps = true;
|
||||
mountData.totalFrames = 5;
|
||||
|
||||
int[] verticalOffsets = new int[mountData.totalFrames];
|
||||
for (int l = 0; l < verticalOffsets.Length; l++)
|
||||
verticalOffsets[l] = 0;
|
||||
|
||||
mountData.playerYOffsets = verticalOffsets;
|
||||
mountData.xOffset = 2;
|
||||
mountData.bodyFrame = 3;
|
||||
mountData.yOffset = 28;
|
||||
mountData.playerHeadOffset = 3;
|
||||
mountData.standingFrameCount = 5;
|
||||
mountData.standingFrameDelay = 5;
|
||||
mountData.standingFrameStart = 0;
|
||||
mountData.runningFrameCount = 5;
|
||||
mountData.runningFrameDelay = 5;
|
||||
mountData.runningFrameStart = 0;
|
||||
mountData.flyingFrameCount = 5;
|
||||
mountData.flyingFrameDelay = 5;
|
||||
mountData.flyingFrameStart = 0;
|
||||
mountData.inAirFrameCount = 5;
|
||||
mountData.inAirFrameDelay = 5;
|
||||
mountData.inAirFrameStart = 0;
|
||||
mountData.idleFrameCount = 5;
|
||||
mountData.idleFrameDelay = 5;
|
||||
mountData.idleFrameStart = 0;
|
||||
mountData.idleFrameLoop = true;
|
||||
mountData.swimFrameCount = 5;
|
||||
mountData.swimFrameDelay = 5;
|
||||
mountData.swimFrameStart = 0;
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
mountData.textureWidth = mountData.frontTexture.Width;
|
||||
mountData.textureHeight = mountData.frontTexture.Height;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Draw(List<DrawData> playerDrawData, int drawType, Player drawPlayer, ref Texture2D texture, ref Texture2D glowTexture, ref Vector2 drawPosition, ref Rectangle frame, ref Color drawColor, ref Color glowColor, ref float rotation, ref SpriteEffects spriteEffects, ref Vector2 drawOrigin, ref float drawScale, float shadow)
|
||||
{
|
||||
rotation = drawPlayer.velocity.X * 0.004f;
|
||||
drawPlayer.fullRotation = rotation;
|
||||
frame = texture.Frame(1, 5, 0, (int)(Main.GlobalTime * 13f) % 5);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 491 B |
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Mounts
|
||||
{
|
||||
public class ExoBox360 : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("ExoBox 360");
|
||||
Tooltip.SetDefault("Creates a rideable flying chair\n" +
|
||||
"Replaced");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 32;
|
||||
item.height = 34;
|
||||
item.useTime = item.useAnimation = 20;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.UseSound = SoundID.Item94;
|
||||
item.noMelee = true;
|
||||
item.mountType = ModContent.MountType<DraedonGamerChairMount>();
|
||||
|
||||
item.value = CalamityGlobalItem.RarityVioletBuyPrice;
|
||||
item.Calamity().customRarity = CalamityRarity.Violet;
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> list)
|
||||
{
|
||||
string hotkey = CalamityMod.ExoChairSpeedupHotkey.TooltipHotkeyString();
|
||||
foreach (TooltipLine line2 in list)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Tooltip1")
|
||||
line2.text = $"Press {hotkey} when on the chair to move much faster";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 729 B |
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Vanity;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Mounts;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
@@ -61,6 +62,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItem(player, ModContent.ItemType<DraedonsHeart>());
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<ExoBox360>(), 5);
|
||||
|
||||
// Vanity
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<ThanosMask>(), 7);
|
||||
|
||||
@@ -2,6 +2,7 @@ using CalamityMod.Events;
|
||||
using CalamityMod.Items.Armor.Vanity;
|
||||
using CalamityMod.Items.LoreItems;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Mounts;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Items.TreasureBags;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
@@ -751,6 +752,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
|
||||
DropHelper.WeightStack<TheAtomSplitter>(w)
|
||||
);
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<ExoBox360>(), 5);
|
||||
|
||||
// Vanity
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<ThanosMask>(), 7);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<ArtemisMask>(), 7);
|
||||
|
||||
Reference in new issue
Block a user