-
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.
Init git at whatever version we're at
- Loading branch information
1 parent
47e21b8
commit f270114
Showing
35 changed files
with
944 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
using System; | ||
using System.IO; | ||
using System.Collections.Generic; | ||
using Terraria; | ||
using Terraria.ID; | ||
using Terraria.ModLoader; | ||
using Terraria.ModLoader.IO; | ||
|
||
namespace CheddarMod | ||
{ | ||
public class CheddarMod : Mod | ||
{ | ||
public CheddarMod() | ||
{ | ||
// Defaults are exactly what they should be | ||
} | ||
} | ||
|
||
public class CheddarModPlayer : ModPlayer | ||
{ | ||
public bool yeet = false; | ||
public bool pocket = false; | ||
public bool ammomancer = false; | ||
public bool stuff = false; | ||
public bool hero = false; | ||
public bool trueHero = false; | ||
public bool flyte = false; | ||
|
||
public override void ResetEffects() | ||
{ | ||
yeet = false; | ||
pocket = false; | ||
ammomancer = false; | ||
stuff = false; | ||
hero = false; | ||
trueHero = false; | ||
flyte = false; | ||
} | ||
|
||
public override void PostUpdate() | ||
{ | ||
if( this.yeet && !player.jumpAgainCloud ) | ||
{ | ||
player.jumpAgainCloud = true; | ||
} | ||
if( this.flyte && player.wingTime < 10f ) | ||
{ | ||
player.wingTime += 200f; | ||
} | ||
} | ||
} | ||
|
||
public class CheddarItem : GlobalItem | ||
{ | ||
public override bool InstancePerEntity | ||
{ | ||
get { return true; } | ||
} | ||
|
||
bool RealAutoReuseValue = false; | ||
bool FakeAutoReuse = false; | ||
|
||
public override bool CloneNewInstances => true; | ||
|
||
public override bool ConsumeAmmo(Item item, Player player) | ||
{ | ||
CheddarModPlayer modPlayer = player.GetModPlayer<CheddarModPlayer>(); | ||
if( modPlayer.ammomancer || modPlayer.stuff ) | ||
{ | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
public override bool ConsumeItem(Item item, Player player) | ||
{ | ||
CheddarModPlayer modPlayer = player.GetModPlayer<CheddarModPlayer>(); | ||
if( modPlayer.stuff ) | ||
{ | ||
return false; | ||
} | ||
else if ( item.thrown && modPlayer.pocket ) | ||
{ | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
public override bool CanUseItem(Item item, Player player) | ||
{ | ||
CheddarModPlayer modPlayer = player.GetModPlayer<CheddarModPlayer>(); | ||
if((modPlayer.trueHero && item.damage > 0) || (item.melee && modPlayer.hero)) | ||
{ | ||
if(!FakeAutoReuse) | ||
{ | ||
RealAutoReuseValue = item.autoReuse; | ||
FakeAutoReuse = true; | ||
} | ||
item.autoReuse = true; | ||
} | ||
else | ||
{ | ||
if(FakeAutoReuse) | ||
{ | ||
item.autoReuse = RealAutoReuseValue; | ||
FakeAutoReuse = false; | ||
} | ||
} | ||
return base.CanUseItem(item, player); | ||
} | ||
} | ||
|
||
public class CheddarProjectile : GlobalProjectile | ||
{ | ||
public override void AI(Projectile projectile) | ||
{ | ||
CheddarModPlayer modPlayer = Main.player[projectile.owner].GetModPlayer<CheddarModPlayer>(); | ||
if((projectile.aiStyle == 19 || projectile.aiStyle == 699) && | ||
Main.player[projectile.owner].HeldItem.melee && (modPlayer.hero || modPlayer.trueHero) && | ||
projectile.timeLeft > Main.player[projectile.owner].itemAnimation) | ||
{ | ||
projectile.timeLeft = Main.player[projectile.owner].itemAnimation; | ||
projectile.netUpdate = true; | ||
} | ||
} | ||
} | ||
} |
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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="..\..\references\tModLoader.targets" /> | ||
<PropertyGroup> | ||
<AssemblyName>CheddarMod</AssemblyName> | ||
<TargetFramework>net45</TargetFramework> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
<Target Name="BuildMod" AfterTargets="Build"> | ||
<Exec Command=""$(tMLBuildServerPath)" -build $(ProjectDir) -eac $(TargetPath) -define $(DefineConstants) -unsafe $(AllowUnsafeBlocks)" /> | ||
</Target> | ||
</Project> |
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,44 @@ | ||
using Terraria; | ||
using Terraria.ID; | ||
using Terraria.ModLoader; | ||
|
||
namespace CheddarMod.Items | ||
{ | ||
public class AmmomancerPouch : ModItem | ||
{ | ||
public override void SetStaticDefaults() | ||
{ | ||
DisplayName.SetDefault("Ammomancer's Pouch"); | ||
Tooltip.SetDefault("Reach beyond the world to never run out of ammunition\nProvides a small boost to ranged abilities"); | ||
} | ||
|
||
public override void SetDefaults() | ||
{ | ||
item.width = 29; | ||
item.height = 36; | ||
item.value = 50000; | ||
item.rare = 5; | ||
item.accessory = true; | ||
} | ||
|
||
public override void UpdateAccessory(Player player, bool hideVisual) | ||
{ | ||
player.rangedDamage += 0.05f; | ||
player.rangedCrit += 5; | ||
|
||
CheddarModPlayer modPlayer = player.GetModPlayer<CheddarModPlayer>(); | ||
modPlayer.ammomancer = true; | ||
} | ||
|
||
public override void AddRecipes() | ||
{ | ||
ModRecipe recipe = new ModRecipe(mod); | ||
recipe.AddIngredient(ItemID.WoodenArrow, 999); | ||
recipe.AddIngredient(ItemID.MusketBall, 999); | ||
recipe.AddIngredient(ItemID.Lens, 2); | ||
recipe.AddTile(TileID.TinkerersWorkbench); | ||
recipe.SetResult(this); | ||
recipe.AddRecipe(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,50 @@ | ||
using Terraria; | ||
using Terraria.ID; | ||
using Terraria.ModLoader; | ||
|
||
namespace CheddarMod.Items | ||
{ | ||
public class Boot : ModItem | ||
{ | ||
public override void SetStaticDefaults() | ||
{ | ||
DisplayName.SetDefault("Boot."); | ||
Tooltip.SetDefault("\"Ya got a Boot.\"\nA little greater than the sum of its parts"); | ||
} | ||
|
||
public override void SetDefaults() | ||
{ | ||
item.width = 30; | ||
item.height = 19; | ||
item.value = 600000; | ||
item.rare = 9; | ||
item.accessory = true; | ||
} | ||
|
||
public override void UpdateAccessory(Player player, bool hideVisual) | ||
{ | ||
player.moveSpeed += 0.16f; | ||
player.waterWalk = true; | ||
player.fireWalk = true; | ||
player.lavaImmune = true; | ||
player.iceSkate = true; | ||
player.accFlipper = true; | ||
player.ignoreWater = true; | ||
player.accRunSpeed = 6.75f; | ||
player.rocketBoots = 3; | ||
} | ||
|
||
public override void AddRecipes() | ||
{ | ||
ModRecipe recipe = new ModRecipe(mod); | ||
recipe.AddIngredient(ItemID.FrostsparkBoots); | ||
recipe.AddIngredient(ItemID.LavaWaders); | ||
recipe.AddIngredient(ItemID.Flipper); | ||
recipe.AddIngredient(ItemID.SoulofLight, 3); | ||
recipe.AddIngredient(ItemID.SoulofNight, 3); | ||
recipe.AddTile(TileID.MythrilAnvil); | ||
recipe.SetResult(this); | ||
recipe.AddRecipe(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,40 @@ | ||
using Terraria; | ||
using Terraria.ID; | ||
using Terraria.ModLoader; | ||
|
||
namespace CheddarMod.Items | ||
{ | ||
public class EternalBacon : ModItem | ||
{ | ||
public override void SetStaticDefaults() | ||
{ | ||
DisplayName.SetDefault("Eternal Bacon"); | ||
Tooltip.SetDefault("Praise the ETERNAL BACON!\nALL PRAISE!"); | ||
} | ||
|
||
public override void SetDefaults() | ||
{ | ||
item.UseSound = SoundID.Item2; | ||
item.useStyle = 2; | ||
item.useTurn = true; | ||
item.useAnimation = 17; | ||
item.useTime = 17; | ||
// item.maxStack = 1; | ||
item.consumable = false; | ||
item.width = 10; | ||
item.height = 10; | ||
item.buffType = 26; | ||
item.buffTime = 216000; | ||
item.rare = 2; | ||
item.value = 10000; | ||
} | ||
|
||
public override void AddRecipes() | ||
{ | ||
ModRecipe recipe = new ModRecipe(mod); | ||
recipe.AddIngredient(ItemID.Bacon, 30); | ||
recipe.SetResult(this); | ||
recipe.AddRecipe(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,96 @@ | ||
using Terraria; | ||
using Terraria.ID; | ||
using Terraria.ModLoader; | ||
|
||
namespace CheddarMod.Items | ||
{ | ||
[AutoloadEquip(EquipType.Wings)] | ||
public class Flyte : ModItem | ||
{ | ||
public override void SetStaticDefaults() | ||
{ | ||
DisplayName.SetDefault("Flyte"); | ||
Tooltip.SetDefault("Flight Eternal"); | ||
} | ||
|
||
public override void SetDefaults() | ||
{ | ||
item.width = 26; | ||
item.height = 38; | ||
item.value = 1000000; | ||
item.rare = 12; | ||
item.accessory = true; | ||
} | ||
|
||
public override void UpdateAccessory(Player player, bool hideVisual) | ||
{ | ||
player.moveSpeed += 0.32f; | ||
player.waterWalk = true; | ||
player.fireWalk = true; | ||
player.lavaImmune = true; | ||
player.iceSkate = true; | ||
player.accFlipper = true; | ||
player.ignoreWater = true; | ||
player.accRunSpeed = 12f; | ||
player.rocketBoots = 3; | ||
|
||
player.jumpBoost = true; | ||
player.noFallDmg = true; | ||
player.autoJump = true; | ||
player.jumpSpeedBoost = 3f; | ||
player.wingTimeMax = 240; | ||
|
||
player.blackBelt = true; | ||
player.dash = 1; | ||
player.spikedBoots = 2; | ||
|
||
CheddarModPlayer modPlayer = player.GetModPlayer<CheddarModPlayer>(); | ||
modPlayer.flyte = true; | ||
} | ||
|
||
public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) | ||
{ | ||
if(player.controlDown && player.controlJump) | ||
{ | ||
ascentWhenRising = 0.2f; | ||
ascentWhenFalling = 0.2f; | ||
maxAscentMultiplier = 1E-05f; | ||
maxCanAscendMultiplier = 1E-05f; | ||
constantAscend = 0.14f; | ||
} | ||
else | ||
{ | ||
ascentWhenFalling = 0.8f; | ||
ascentWhenRising = 0.2f; | ||
maxCanAscendMultiplier = 4f; | ||
maxAscentMultiplier = 2f; | ||
constantAscend = 0.14f; | ||
} | ||
} | ||
|
||
public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) | ||
{ | ||
if(player.controlDown && player.controlJump) | ||
{ | ||
speed = 30f; | ||
acceleration *= 7f; | ||
} | ||
else | ||
{ | ||
speed = 10f; | ||
acceleration *= 3f; | ||
} | ||
} | ||
|
||
public override void AddRecipes() | ||
{ | ||
ModRecipe recipe = new ModRecipe(mod); | ||
recipe.AddIngredient(ItemID.MasterNinjaGear); | ||
recipe.AddIngredient(mod, "StarThreads"); | ||
recipe.AddIngredient(ItemID.BeetleHusk, 5); | ||
recipe.AddTile(TileID.LunarCraftingStation); | ||
recipe.SetResult(this); | ||
recipe.AddRecipe(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.