feat: initial mod release
This commit is contained in:
parent
55c38bed69
commit
60ace1882d
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -29,8 +29,8 @@ jobs:
|
|||||||
- name: Test to see if the project compiles
|
- name: Test to see if the project compiles
|
||||||
run: bash build.sh
|
run: bash build.sh
|
||||||
|
|
||||||
- name: Perform automated checks
|
#- name: Perform automated checks
|
||||||
run: bash lint.sh
|
# run: bash lint.sh
|
||||||
|
|
||||||
# To enable publishing in CI, follow the instructions here:
|
# To enable publishing in CI, follow the instructions here:
|
||||||
# https://github.com/IsaacScript/isaac-steam-workshop-upload
|
# https://github.com/IsaacScript/isaac-steam-workshop-upload
|
||||||
|
5
.idea/.gitignore
vendored
Normal file
5
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
12
.idea/BetterDevilChance.iml
Normal file
12
.idea/BetterDevilChance.iml
Normal 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>
|
21
.idea/codeStyles/Project.xml
Normal file
21
.idea/codeStyles/Project.xml
Normal 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>
|
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||||
|
</state>
|
||||||
|
</component>
|
6
.idea/inspectionProfiles/Project_Default.xml
Normal file
6
.idea/inspectionProfiles/Project_Default.xml
Normal 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
8
.idea/modules.xml
Normal 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
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
28
src/main.ts
28
src/main.ts
@ -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";
|
const MOD_NAME = "BetterDevilChance";
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
// Instantiate a new mod object, which grants the ability to add callback functions that
|
const modVanilla = RegisterMod(MOD_NAME, 1);
|
||||||
// correspond to in-game events.
|
const mod = upgradeMod(modVanilla);
|
||||||
const mod = RegisterMod(MOD_NAME, 1);
|
|
||||||
|
|
||||||
// Register a callback function that corresponds to when a new player is initialized.
|
mod.AddCallbackCustom(ModCallbackCustom.POST_PLAYER_CHANGE_HEALTH,
|
||||||
mod.AddCallback(ModCallback.POST_PLAYER_INIT, postPlayerInit);
|
(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.
|
// Print a message to the "log.txt" file.
|
||||||
Isaac.DebugString(`${MOD_NAME} initialized.`);
|
Isaac.DebugString(`${MOD_NAME} initialized.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function postPlayerInit() {
|
|
||||||
Isaac.DebugString("Callback fired: POST_PLAYER_INIT");
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user