Adding files
This commit is contained in:
10
src/bundleEntry.ts
Normal file
10
src/bundleEntry.ts
Normal file
@ -0,0 +1,10 @@
|
||||
// This is the entry point for the TypeScriptToLua bundler, which is set in the "tsconfig.json" file
|
||||
// All this file does is immediately execute the "main()" function in the "main.ts" file
|
||||
// (We don't want to point the TypeScriptToLua bundler at the "main.ts" file directly, because any
|
||||
// variables or functions that are declared in a bundle entry point will become global)
|
||||
|
||||
import { main } from "./main";
|
||||
|
||||
main();
|
||||
|
||||
// Do not add any code to this file!
|
20
src/main.ts
Normal file
20
src/main.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import { getPlayersOfType } from "isaacscript-common";
|
||||
|
||||
export function main(): void {
|
||||
// Instantiate a new mod object, which grants the ability to add callback functions that
|
||||
// correspond to in-game events
|
||||
const mod = RegisterMod("Blue Baby Petrified Poop", 1);
|
||||
|
||||
// Set a callback function that corresponds to when a new run is started
|
||||
mod.AddCallback(ModCallbacks.MC_POST_PLAYER_INIT, postRunBegin);
|
||||
|
||||
// Print an initialization message to the "log.txt" file
|
||||
Isaac.DebugString("BlueBabyPetrifiedStart initialized.");
|
||||
}
|
||||
|
||||
function postRunBegin() {
|
||||
for (const player of getPlayersOfType(PlayerType.PLAYER_BLUEBABY)) {
|
||||
player.AddTrinket(TrinketType.TRINKET_PETRIFIED_POOP);
|
||||
Game().GetItemPool().RemoveTrinket(TrinketType.TRINKET_PETRIFIED_POOP);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user