-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SoloTogether and BunnyExtinction #6
base: main
Are you sure you want to change the base?
Conversation
HyperbolicPlus version 1.0.2, used for tournament 1
Basic enemies can now be used
Rewriting BattleData to have cleaner structure
Added new config settings Imported old battleData Fixed basic patterns
Hyperbolic+ Fixed random for mixes Added player death order print BunnyExtinction: Added BunnyExtinction 0.0.1
Added Twili1 mix
Timed all bosses Merran phase 1 and Matti phase 2 cannot be played as mixes
hook for diffswitch would affect enemy health and patterns. A check was added to only affect player health
Items like Sunflower Crown, Grasswoven Bracelet, and Vitality Potion no longer give extra health. Config also properly updates when option is enabled or disabled
Max speed is now 6.30, or -2 in terms of base stats
Updated README's for MicrowaveBunny's mods. Now includes acknowledgement for users who helped with development
Invuln now works properly in BEX. Shira invulns work properly again
Array for storing speeds was incorrectly initialized
Now works if host is spectating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I got all the cases where you're returning a reference to a variable on the stack, but if I missed any that you know of feel free to fix them.
if (this.IsReady(out var rnsReloaded, out var hooks, out var utils, out var scrbp, out var bp)) { | ||
// setting hp to smite players | ||
RValue* playerHp = rnsReloaded.FindValue(rnsReloaded.GetGlobalInstance(), "playerHp"); | ||
for (int i = 0; i < 4; i++) { // iterate through bitmask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend using utils.getNumPlayers()
instead of 4
here.
returnValue = hook!.OriginalFunction(self, other, returnValue, argc, argv); | ||
// diifSwitch is used for multiple things | ||
// to intercept health, we check all the arguments | ||
if (argv[0]->Real == 8 && argv[1]->Real == 5 && argv[2]->Real == 5 && argv[3]->Real == 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add comments to what the args mean/why you're looking for those specific values if you know?
// store original speed | ||
var s = new RValue(self); | ||
int id = (int) utils.RValueToLong(rnsReloaded.FindValue(self, "playerId")); | ||
this.movementSpeeds[id] = utils.RValueToDouble(returnValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break if there's ever >4 players. Which might happen in the future, IDK.
RValue newRadius = new RValue(-1); | ||
argv[2] = &newRadius; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of setting this to a reference to newly created variable could you just instead set arvg[2]->Real
and argv[2]->Type
fields?
I'm not 100% sure this is memory safe and I suspect it'll either cause a potential segfault (if &newRadius
is allocated on the stack, or a memory leak with either this or the old argument not being properly garbage collected, potentially.
RValue result = new RValue(0); | ||
return &result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not memory safe, please modify returnValue
and return it.
|
||
private RValue* EnrageTimeDetour(CInstance* self, CInstance* other, RValue* returnValue, int argc, RValue** argv) { | ||
var a = new RValue(-1); | ||
return &a; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, don't return a reference to a variable on the stack.
private RValue* ReviveDetour(CInstance* self, CInstance* other, RValue* returnValue, int argc, RValue** argv) { | ||
// canRevive is false | ||
RValue result = new RValue(0); | ||
return &result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again.
// if KOtimer is drawn, add player to mask | ||
int id = (int) utils.RValueToLong(argv[0]); | ||
if ((this.deadPlayers & (1 << id)) == 0) { // player hasn't been marked dead yet | ||
Console.WriteLine($"Player {id} has just fallen"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the logging library instead of Console.WriteLine
@@ -0,0 +1,76 @@ | |||
using System.Drawing; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate file, remove and use the RNSReloaded
version.
|
||
private RValue* ReviveDetour(CInstance* self, CInstance* other, RValue* returnValue, int argc, RValue** argv) { | ||
var hook = ScriptHooks["scr_kotracker_can_revive"]; | ||
RValue result = new RValue(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This again
Please publish only SoloTogether and BunnyExtinction. Do not publish HyperbolicPlus yet.
Add new mods, SoloTogether and BunnyExtinction
Updates Fullmetal to be compatible with first hallway choice
README of Fullmetal now contains attributions for people who have helped with the project