beetrootmonkey / moonstones Goto Github PK
View Code? Open in Web Editor NEWSmall Terraria mod that allows manually applying modifiers to items.
License: GNU General Public License v3.0
Small Terraria mod that allows manually applying modifiers to items.
License: GNU General Public License v3.0
Some modifiers (or maybe completely at random?) won't get applied to moonstones when awakening them, thus yielding a 'Moonstone (Weapons/Accessories)" without any prefix. When applied to an item, it will do nothing (except take away any modifier), which leads me to believe there wasn't any modifier on the moonstone to begin with.
I didn't implement a way to configure the mod yet (= the drop rate of moonstones). Suppose I should find out how to read from a config file.
Hello, again Beetrootmonkey,
Since I edited the mod the first time I encountered a few more problems.
As you may know, Terraria will not let you apply a modifier if the item does not have the respective stats like if you don't have a damage value on the item that is more than 5 you will not be able to get Legendary.
I found a solution.
In the MoonstoneWeapon.cs you should add the following lines inside the curly brackets of SetDefaults()
item.damage = 5;
item.knockBack = 5;
item.mana = 5;
If you make the item have a damage, knockback, and mana value, it will let it have modifiers that edit those values.
Terraria cant apply legendary to an item with less than 5 damage. It also can't apply a mana cost modifier to an item with less than 5 mana. Knockback at 5 is just for consistency.
This will let you get every weapon modifier on the weapons moonstone...
It will let accessory mods on it as well, so I suggest you add these lines inside the curly brackets of ChoosePrefix(UnifiedRandom rand)
byte roll = (byte)rand.Next(1, 83) >= 3 ? (byte)rand.Next(1, 61) : (byte)rand.Next(81, 84);
return roll;
It will exclude the accessory modifiers and still allow all the weapon ones.
As always I would prefer if I was given recognition for the code...
Thank you for your time,
Yangfu1000, The Shy Coder
The line 'item.SetNameOverride("...")' propably changes the name of some random items in the world when dropped to 'Moonstone (Dormant)' for some reason.
Hi Beetrootmonkey,
I was doing a modded multiplayer playthrough with some friends. I noticed that every single time anyone clicked the dormant moonstone, it would always give an accessory. So, a full stack of dormant moonstones later, there was not a singular weapon moonstone...
I'm also a coder, so I downloaded the mod files and did some debugging. I don't know if this is a mistake in the API or the mod but I found a solution to fix the bug.
In line 31 of MoonstoneBlank.cs I changed it to
if (Main.rand.Next(2) == 1)
instead of
if (Main.rand.Next(1) != 0)
That was the only change I found was needed.
I tested the edited code with another full stack of dormant moonstones just to see if it was a 50 50 chance to get a weapon or accessory. It seemed to be successful having about a 50 50 chance give or take a few.
I have not used this in Singleplayer, but I just wanted to let you know and give a suggestion how to fix it.
In the event that you accept my suggestion, I hope that it helps and possibly give me recognition?
Sincerely,
Yangfu1000- The Shy Coder
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.