-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinit.lua
193 lines (158 loc) · 8.74 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
--[[
api issues
no event callback hook registration whatver for certain important actions
the biggest nice to haves:
entity created / loaded
projectiles fired in a spell cast
no overriding of base game events in a modular interoperable way (currently have to overwrite or keep custom code up to date
with every change)
not enough returning of important values in widely use functions
too much blackboxing of otherwise important game information (the biome levels in generate_shop_item for example)
no component copy methods
changelog
kill streaks events
grze events
passives as mini perks
greed
HitEffect considerations
ElectricitySourceComponent
DamageNearbyEntitiesComponent
WormAttractorComponent
TODO
a projectile spell that wanders about with a high lifetime
slowing attack champion
modifier that reduces the projectile resistance of target it hits
wand passive enemy drops one additional gold nugget
king champion: champion enemies nearby
infested champion: spawn rats, spiders, or mini lobs upon death
demolitionist champion: explosive projectiles
look into using spread to determine formation stack distance
champions that move the player around
7 cast odd firebolt gravity well
figure out physics based projectile velocity application
look into what it takes to perform actions with an AbilityComponent
add a disable cosmetic particles blacklist for certain entities (might not be possible)
golden recharge (picking up gold reduces the recharge time on the wand) (passive? perk?)
spell drop chance (drop money override, a chance to drop a spell of equal value)
modifier that applies the next modifier to all projectiles in the wand
make enemies imperfect / take time to aim towards you
try a pathfinding algorithm
UTILITY
TODO
Spell Power (utility stat on wand stat windows) (not yet possible?)
ACTIONS
TODO
cut duration
Swarm Projectile Modifier (like Spellbundle, but a proper modifier and on enemies)
Sticky Projectile Modifier (stick to surfaces / enemies) (useful for what kinds of projectiles?)
Dynamic spell compression (combine random spells into single cards that expand into their actions when cast)
PERKS
TODO
Double Cast (all spells cast twice)
Lucky Dodge (small chance to evade damage) (can't be implemented how i want it yet)
Crit Crits (crits can crit) (probably can't do this yet)
Wand Merge (merge two wands into a new wand with the best aspects of either wand)
Lucky Draw (reset the perk reroll cost)
Gold Rush (enemies explode into more and more gold as your kill streak continues)
Chaos (randomize projectile stuff)
NYI
Dual Wield would probably be an excessively difficulty task to implement, but it would be cool if you could designate a Wand to dual wield.
ABANDONED
Lava, Acid, Poison (Material) Immunities (impossible for now? can ignore _all_ materials, but not individual materials)
damage_materials cached or something
Stunlock Immunity (might be possible with small levels of knockback protection?)
just don't think it's possible right now
Life Steal (1% of damage dealt is returned as life)
probably overpowered
Spell Steal ( n% gain an additional spell charge for a random (weighted by max use) spell in a random wand )
probably overpowered
Slot Machine (official mechanic)
could still be done buuuuuuuut...
The ability to swallow an item (wand, spell, flask?) and spit it back up upon taking damage? Kind of weird, but has interesting utility. Basically a janky additional inventory slot.
Projectile Repulsion Field (official mechanic)
]]
dofile_once( "mods/gkbrkn_noita/files/gkbrkn/lib/helper.lua");
dofile_once( "mods/gkbrkn_noita/files/gkbrkn/helper.lua");
dofile_once( "mods/gkbrkn_noita/files/gkbrkn/config.lua");
dofile_once( "mods/gkbrkn_noita/files/gkbrkn/lib/variables.lua");
dofile_once( "data/scripts/lib/utilities.lua");
if HasFlagPersistent("gkbrkn_first_launch") == false then
AddFlagPersistent("gkbrkn_first_launch")
for _,content in pairs(CONTENT) do
if content.disabled_by_default == true then
AddFlagPersistent( get_content_flag( content.id ) );
end
end
for _,option in pairs(OPTIONS) do
if option.EnabledByDefault == true then
AddFlagPersistent( option.PersistentFlag );
end
end
end
ModLuaFileAppend( "data/scripts/gun/gun.lua", "mods/gkbrkn_noita/files/gkbrkn/append/gun.lua" );
ModLuaFileAppend( "data/scripts/gun/gun_extra_modifiers.lua", "mods/gkbrkn_noita/files/gkbrkn/append/gun_extra_modifiers.lua" );
for content_id,content in pairs( CONTENT ) do
if content.init_function ~= nil and content.enabled() then
content.init_function();
end
end
--ModLuaFileAppend( "data/scripts/gun/gun_actions.lua", "mods/gkbrkn_noita/files/gkbrkn/misc/action_info.lua" );
ModLuaFileAppend( "data/scripts/gun/gun_actions.lua", "mods/gkbrkn_noita/files/gkbrkn/misc/tweak_actions.lua" );
ModLuaFileAppend( "data/scripts/perks/perk_list.lua", "mods/gkbrkn_noita/files/gkbrkn/misc/tweak_perks.lua" );
ModLuaFileAppend( "data/scripts/biomes/temple_altar.lua", "mods/gkbrkn_noita/files/gkbrkn/append/temple_altar.lua" );
if HasFlagPersistent( MISC.NoPregenWands.Enabled ) then
local pregen_wand_biomes = {
"data/scripts/biomes/coalmine.lua",
"data/scripts/biomes/coalmine_alt.lua",
};
for _,entry in pairs( pregen_wand_biomes ) do
ModLuaFileAppend( entry, "mods/gkbrkn_noita/files/gkbrkn/append/no_preset_wands.lua" );
end
end
if HasFlagPersistent( MISC.LooseSpellGeneration.Enabled ) then
ModLuaFileAppend( "data/scripts/gun/gun_actions.lua", "mods/gkbrkn_noita/files/gkbrkn/misc/loose_spell_generation.lua" );
end
ModLuaFileAppend( "data/scripts/items/drop_money.lua", "mods/gkbrkn_noita/files/gkbrkn/misc/charm_nerf.lua" );
ModLuaFileAppend( "data/scripts/gun/procedural/gun_procedural.lua", "mods/gkbrkn_noita/files/gkbrkn/append/gun_procedural.lua" );
ModLuaFileAppend( "data/scripts/items/generate_shop_item.lua", "mods/gkbrkn_noita/files/gkbrkn/misc/wand_shops_only.lua" );
function OnPlayerSpawned( player_entity )
if HasFlagPersistent( MISC.DisableSpells.Enabled ) then
ModLuaFileAppend( "data/scripts/gun/gun_actions.lua", "mods/gkbrkn_noita/files/gkbrkn/misc/disable_spells.lua" );
end
if #(EntityGetWithTag( "gkbrkn_mod_config") or {}) == 0 then
EntityLoad('mods/gkbrkn_noita/files/gkbrkn/gui/container.xml');
end
DoFileEnvironment( "mods/gkbrkn_noita/files/gkbrkn/player_spawned.lua", { player_entity = player_entity } );
end
-- this file is mostly for backwards compatibility of the base game and more loadouts mods. this method should not be relied upon as it
-- needs to know the layout and functionality of the underlying mods
-- prefer utilizing the register_loadout function like the examples
function try_append( init_filepath, support_append_filepath )
local _, err = loadfile( init_filepath );
if err == nil then
ModLuaFileAppend( init_filepath, support_append_filepath );
end
end
if HasFlagPersistent( MISC.Loadouts.Manage ) then
try_append( "mods/starting_loadouts/init.lua", "mods/gkbrkn_noita/files/gkbrkn_loadouts/starting_loadouts_support.lua" );
try_append( "mods/more_loadouts/init.lua", "mods/gkbrkn_noita/files/gkbrkn_loadouts/more_loadouts_support.lua" );
try_append( "mods/Kaelos_Archetypes/init.lua", "mods/gkbrkn_noita/files/gkbrkn_loadouts/kaelos_loadouts_support.lua" );
end
if HasFlagPersistent( MISC.Badges.Enabled ) then
try_append( "mods/nightmare/init.lua", "mods/gkbrkn_noita/files/gkbrkn/append/nightmare_mode_badge.lua" );
end
function OnModPreInit()
-- append the logic to parse the old loadouts as new loadouts
ModLuaFileAppend( "mods/gkbrkn_noita/files/gkbrkn_loadouts/loadouts.lua", "mods/gkbrkn_noita/files/gkbrkn_loadouts/parse_old_loadouts.lua" );
-- slap the fully combined set of loadout files onto the end of config so it can be caught by the config menu and performed
ModLuaFileAppend( "mods/gkbrkn_noita/files/gkbrkn/config.lua", "mods/gkbrkn_noita/files/gkbrkn_loadouts/loadouts.lua" );
end
function OnModPostInit()
if HasFlagPersistent( MISC.LimitedAmmo.Enabled ) then
ModLuaFileAppend( "data/scripts/gun/gun_actions.lua", "mods/gkbrkn_noita/files/gkbrkn/misc/limited_ammo.lua" );
end
if HasFlagPersistent( MISC.UnlimitedAmmo.Enabled ) then
ModLuaFileAppend( "data/scripts/gun/gun_actions.lua", "mods/gkbrkn_noita/files/gkbrkn/misc/unlimited_ammo.lua" );
end
ModLuaFileAppend( "mods/gkbrkn_noita/files/gkbrkn/config.lua", "mods/gkbrkn_noita/files/gkbrkn/starting_perks_config_append.lua" );
end