feat: initial mod release

This commit is contained in:
Isaac Shoebottom 2023-05-17 22:36:23 -03:00
parent 55c38bed69
commit 60ace1882d
9 changed files with 85 additions and 14 deletions

View File

@ -29,8 +29,8 @@ jobs:
- name: Test to see if the project compiles
run: bash build.sh
- name: Perform automated checks
run: bash lint.sh
#- name: Perform automated checks
# run: bash lint.sh
# To enable publishing in CI, follow the instructions here:
# https://github.com/IsaacScript/isaac-steam-workshop-upload

5
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,21 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="JavaScript">
<option name="BLOCK_COMMENT_ADD_SPACE" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="BLOCK_COMMENT_ADD_SPACE" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<indentOptions>
<option name="USE_TAB_CHARACTER" value="true" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/BetterDevilChance.iml" filepath="$PROJECT_DIR$/.idea/BetterDevilChance.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,21 +1,29 @@
import { ModCallback } from "isaac-typescript-definitions";
import {HealthType, ModCallbackCustom, upgradeMod} from "isaacscript-common";
import {LevelStateFlag} from "isaac-typescript-definitions";
const MOD_NAME = "BetterDevilChance";
main();
function main() {
// Instantiate a new mod object, which grants the ability to add callback functions that
// correspond to in-game events.
const mod = RegisterMod(MOD_NAME, 1);
const modVanilla = RegisterMod(MOD_NAME, 1);
const mod = upgradeMod(modVanilla);
// Register a callback function that corresponds to when a new player is initialized.
mod.AddCallback(ModCallback.POST_PLAYER_INIT, postPlayerInit);
mod.AddCallbackCustom(ModCallbackCustom.POST_PLAYER_CHANGE_HEALTH,
(player, healthType) => {
Isaac.DebugString("Callback fired: POST_PLAYER_CHANGE_HEALTH");
if (healthType !== HealthType.RED) { // Only care about red hearts
return
}
if (!player.HasFullHearts()) { // Only care about full hearts
return
}
Game().GetLevel().SetStateFlag(LevelStateFlag.RED_HEART_DAMAGED, false)
Isaac.DebugString(`${MOD_NAME}: Regained full red hearts. Devil chance restored.`)
})
// Print a message to the "log.txt" file.
Isaac.DebugString(`${MOD_NAME} initialized.`);
}
function postPlayerInit() {
Isaac.DebugString("Callback fired: POST_PLAYER_INIT");
}