-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
393 additions
and
395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import { ModCallback } from "isaac-typescript-definitions"; | ||
import { DamageFlagsCustom } from "../enums/DamageFlagsCustom"; | ||
import { playerHasSamuraisBladeItem } from "../helpers/Helpers"; | ||
import { SamuraiBladeEntityDamage } from "../items/SamuraisBlade"; | ||
import {ModCallback} from "isaac-typescript-definitions"; | ||
import {DamageFlagsCustom} from "../enums/DamageFlagsCustom"; | ||
import {playerHasSamuraisBladeItem} from "../helpers/Helpers"; | ||
import {SamuraiBladeEntityDamage} from "../items/SamuraisBlade"; | ||
|
||
export function entityTakeDamageInit(mod: Mod): void { | ||
mod.AddCallback(ModCallback.ENTITY_TAKE_DMG, entityTakeDamageMain); | ||
mod.AddCallback(ModCallback.ENTITY_TAKE_DMG, entityTakeDamageMain); | ||
} | ||
|
||
function entityTakeDamageMain( | ||
tookDamage: Entity, | ||
damageAmount: number, | ||
damageFlags: BitFlag, | ||
damageSource: EntityRef, | ||
damageCountdownFrames: number, | ||
tookDamage: Entity, | ||
damageAmount: number, | ||
damageFlags: BitFlag, | ||
damageSource: EntityRef, | ||
damageCountdownFrames: number, | ||
): boolean | undefined { | ||
const player = damageSource.Entity?.ToPlayer(); | ||
const player = damageSource.Entity?.ToPlayer(); | ||
|
||
// flog(`Extending berserk! ${player} ${tookDamage.HasMortalDamage()}}`); | ||
// if (player) { | ||
// extendBerserk(player); | ||
// } | ||
// flog(`Extending berserk! ${player} ${tookDamage.HasMortalDamage()}}`); | ||
// if (player) { | ||
// extendBerserk(player); | ||
// } | ||
|
||
if (player !== undefined && playerHasSamuraisBladeItem(player) && tookDamage.IsVulnerableEnemy() && damageFlags === DamageFlagsCustom.SB_BLADE_DAMAGE) { | ||
SamuraiBladeEntityDamage(tookDamage, damageAmount, damageFlags, damageSource, damageCountdownFrames); | ||
} | ||
return undefined; | ||
if (player !== undefined && playerHasSamuraisBladeItem(player) && tookDamage.IsVulnerableEnemy() && damageFlags === DamageFlagsCustom.SB_BLADE_DAMAGE) { | ||
SamuraiBladeEntityDamage(tookDamage, damageAmount, damageFlags, damageSource, damageCountdownFrames); | ||
} | ||
return undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { CacheFlag, ModCallback } from "isaac-typescript-definitions"; | ||
import { getPlayerStateDataNoCreate } from "../data/StateData"; | ||
import { flog } from "../helpers/DebugHelper"; | ||
import { playerHasSamuraisBladeItem } from "../helpers/Helpers"; | ||
import { SamuraiBladeEvalCache } from "../items/SamuraisBlade"; | ||
import {CacheFlag, ModCallback} from "isaac-typescript-definitions"; | ||
import {getPlayerStateDataNoCreate} from "../data/StateData"; | ||
import {flog} from "../helpers/DebugHelper"; | ||
import {playerHasSamuraisBladeItem} from "../helpers/Helpers"; | ||
import {SamuraiBladeEvalCache} from "../items/SamuraisBlade"; | ||
|
||
const LOG_ID = "MCEvaluateCache"; | ||
|
||
export function evaluateCacheInit(mod: Mod): void { | ||
mod.AddCallback(ModCallback.EVALUATE_CACHE, main); | ||
mod.AddCallback(ModCallback.EVALUATE_CACHE, main); | ||
} | ||
|
||
function main(player: EntityPlayer, cacheFlag: CacheFlag) { | ||
if (cacheFlag === CacheFlag.LUCK && getPlayerStateDataNoCreate(player) === undefined && playerHasSamuraisBladeItem(player)) { | ||
flog("Player is now motivated", LOG_ID); | ||
SamuraiBladeEvalCache(player, cacheFlag); | ||
} | ||
if (cacheFlag === CacheFlag.LUCK && getPlayerStateDataNoCreate(player) === undefined && playerHasSamuraisBladeItem(player)) { | ||
flog("Player is now motivated", LOG_ID); | ||
SamuraiBladeEvalCache(player, cacheFlag); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { CollectibleType } from "isaac-typescript-definitions"; | ||
import { ModCallbackCustom, ModUpgraded } from "isaacscript-common"; | ||
import { CollectibleTypeCustom } from "../enums/CollectibleTypeCustom"; | ||
import { infoLog } from "../helpers/DebugHelper"; | ||
import {CollectibleType} from "isaac-typescript-definitions"; | ||
import {ModCallbackCustom, ModUpgraded} from "isaacscript-common"; | ||
import {CollectibleTypeCustom} from "../enums/CollectibleTypeCustom"; | ||
import {infoLog} from "../helpers/DebugHelper"; | ||
|
||
export function postCollectibleRemoved(mod: ModUpgraded): void { | ||
mod.AddCallbackCustom(ModCallbackCustom.POST_PLAYER_COLLECTIBLE_REMOVED, main, CollectibleTypeCustom.SB_SAMURAI_BLADE); | ||
mod.AddCallbackCustom(ModCallbackCustom.POST_PLAYER_COLLECTIBLE_REMOVED, main, CollectibleTypeCustom.SB_SAMURAI_BLADE); | ||
} | ||
|
||
function main(player: EntityPlayer, collectibleType: CollectibleType) { | ||
infoLog(`Item is gone, this is so sad. so sad indeed... ${collectibleType} `); | ||
infoLog(`Item is gone, this is so sad. so sad indeed... ${collectibleType} `); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { ModCallback } from "isaac-typescript-definitions"; | ||
import { ModUpgraded } from "isaacscript-common"; | ||
import { SamuraiBladePostGameStarted } from "../items/SamuraisBlade"; | ||
import {ModCallback} from "isaac-typescript-definitions"; | ||
import {ModUpgraded} from "isaacscript-common"; | ||
import {SamuraiBladePostGameStarted} from "../items/SamuraisBlade"; | ||
|
||
export function postGameStartedInit(mod: ModUpgraded): void { | ||
mod.AddCallback(ModCallback.POST_GAME_STARTED, () => { | ||
main(mod); | ||
}); | ||
mod.AddCallback(ModCallback.POST_GAME_STARTED, () => { | ||
main(mod); | ||
}); | ||
} | ||
|
||
function main(mod: ModUpgraded) { | ||
SamuraiBladePostGameStarted(mod); | ||
SamuraiBladePostGameStarted(mod); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
import { ItemType } from "isaac-typescript-definitions"; | ||
import { | ||
ModCallbackCustom, | ||
ModUpgraded, | ||
PickingUpItem, | ||
} from "isaacscript-common"; | ||
import { CollectibleTypeCustom } from "../enums/CollectibleTypeCustom"; | ||
import { flog } from "../helpers/DebugHelper"; | ||
import { SamuraiBladePostPickup } from "../items/SamuraisBlade"; | ||
import {ItemType} from "isaac-typescript-definitions"; | ||
import {ModCallbackCustom, ModUpgraded, PickingUpItem,} from "isaacscript-common"; | ||
import {CollectibleTypeCustom} from "../enums/CollectibleTypeCustom"; | ||
import {flog} from "../helpers/DebugHelper"; | ||
import {SamuraiBladePostPickup} from "../items/SamuraisBlade"; | ||
|
||
export function postItemPickupInit(mod: ModUpgraded): void { | ||
mod.AddCallbackCustom( | ||
ModCallbackCustom.POST_ITEM_PICKUP, | ||
main, | ||
ItemType.PASSIVE, | ||
CollectibleTypeCustom.SB_SAMURAI_BLADE, | ||
); | ||
mod.AddCallbackCustom( | ||
ModCallbackCustom.POST_ITEM_PICKUP, | ||
main, | ||
ItemType.PASSIVE, | ||
CollectibleTypeCustom.SB_SAMURAI_BLADE, | ||
); | ||
} | ||
|
||
function main(player: EntityPlayer, pickingUpItem: PickingUpItem) { | ||
flog("Item:" + pickingUpItem, "CALLBACK"); | ||
SamuraiBladePostPickup(player); | ||
flog("Item:" + pickingUpItem, "CALLBACK"); | ||
SamuraiBladePostPickup(player); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { ModCallback } from "isaac-typescript-definitions"; | ||
import { SamuraiBladePostNewRoom } from "../items/SamuraisBlade"; | ||
import {ModCallback} from "isaac-typescript-definitions"; | ||
import {SamuraiBladePostNewRoom} from "../items/SamuraisBlade"; | ||
|
||
export function postNewRoomInit(mod: Mod): void { | ||
mod.AddCallback(ModCallback.POST_NEW_ROOM, main); | ||
mod.AddCallback(ModCallback.POST_NEW_ROOM, main); | ||
} | ||
|
||
function main() { | ||
SamuraiBladePostNewRoom(); | ||
SamuraiBladePostNewRoom(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { ModCallback } from "isaac-typescript-definitions"; | ||
import { renderHudForPlayers } from "../items/samuraiBlade/hud/HudRenderer"; | ||
import { SamuraiBladePostRender } from "../items/SamuraisBlade"; | ||
import {ModCallback} from "isaac-typescript-definitions"; | ||
import {renderHudForPlayers} from "../items/samuraiBlade/hud/HudRenderer"; | ||
import {SamuraiBladePostRender} from "../items/SamuraisBlade"; | ||
|
||
export function postRenderInit(mod: Mod): void { | ||
mod.AddCallback(ModCallback.POST_RENDER, main); | ||
mod.AddCallback(ModCallback.POST_RENDER, main); | ||
} | ||
|
||
function main() { | ||
SamuraiBladePostRender(); | ||
SamuraiBladePostRender(); | ||
|
||
renderHudForPlayers(); | ||
renderHudForPlayers(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { ModCallback } from "isaac-typescript-definitions"; | ||
import { SamuraiBladePostRenderPickup } from "../items/SamuraisBlade"; | ||
import {ModCallback} from "isaac-typescript-definitions"; | ||
import {SamuraiBladePostRenderPickup} from "../items/SamuraisBlade"; | ||
|
||
export function postRenderPickupInit(mod: Mod): void { | ||
mod.AddCallback(ModCallback.POST_PICKUP_RENDER, main); | ||
mod.AddCallback(ModCallback.POST_PICKUP_RENDER, main); | ||
} | ||
|
||
function main() { | ||
SamuraiBladePostRenderPickup(); | ||
SamuraiBladePostRenderPickup(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { ModCallback } from "isaac-typescript-definitions"; | ||
import { SamuraiBladePostRenderPlayer } from "../items/SamuraisBlade"; | ||
import {ModCallback} from "isaac-typescript-definitions"; | ||
import {SamuraiBladePostRenderPlayer} from "../items/SamuraisBlade"; | ||
|
||
export function postRenderPlayerInit(mod: Mod): void { | ||
mod.AddCallback(ModCallback.POST_PLAYER_RENDER, main); | ||
mod.AddCallback(ModCallback.POST_PLAYER_RENDER, main); | ||
} | ||
|
||
function main() { | ||
SamuraiBladePostRenderPlayer(); | ||
SamuraiBladePostRenderPlayer(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { ModCallback } from "isaac-typescript-definitions"; | ||
import { SamuraiBladePostTearUpdate } from "../items/SamuraisBlade"; | ||
import {ModCallback} from "isaac-typescript-definitions"; | ||
import {SamuraiBladePostTearUpdate} from "../items/SamuraisBlade"; | ||
|
||
export function postTearUpdateInit(mod: Mod): void { | ||
mod.AddCallback(ModCallback.POST_TEAR_UPDATE, main); | ||
mod.AddCallback(ModCallback.POST_TEAR_UPDATE, main); | ||
} | ||
|
||
function main(tear: EntityTear) { | ||
SamuraiBladePostTearUpdate(tear); | ||
SamuraiBladePostTearUpdate(tear); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { ModCallback } from "isaac-typescript-definitions"; | ||
import { SamuraiBladePostUpdate } from "../items/SamuraisBlade"; | ||
import {ModCallback} from "isaac-typescript-definitions"; | ||
import {SamuraiBladePostUpdate} from "../items/SamuraisBlade"; | ||
|
||
export function postUpdateInit(mod: Mod): void { | ||
mod.AddCallback(ModCallback.POST_UPDATE, main); | ||
mod.AddCallback(ModCallback.POST_UPDATE, main); | ||
} | ||
|
||
function main() { | ||
SamuraiBladePostUpdate(); | ||
SamuraiBladePostUpdate(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { ModCallback } from "isaac-typescript-definitions"; | ||
import { ModUpgraded } from "isaacscript-common"; | ||
import { SamuraiBladePreGameExit } from "../items/SamuraisBlade"; | ||
import {ModCallback} from "isaac-typescript-definitions"; | ||
import {ModUpgraded} from "isaacscript-common"; | ||
import {SamuraiBladePreGameExit} from "../items/SamuraisBlade"; | ||
|
||
export function preGameExitInit(mod: ModUpgraded): void { | ||
mod.AddCallback(ModCallback.PRE_GAME_EXIT, () => { | ||
main(mod); | ||
}); | ||
mod.AddCallback(ModCallback.PRE_GAME_EXIT, () => { | ||
main(mod); | ||
}); | ||
} | ||
|
||
function main(mod: ModUpgraded) { | ||
SamuraiBladePreGameExit(mod); | ||
SamuraiBladePreGameExit(mod); | ||
} |
Oops, something went wrong.