Skip to content

Commit

Permalink
relocating example_mods under Mods subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
Steamo committed Mar 29, 2024
1 parent e8d8b58 commit b2299f5
Show file tree
Hide file tree
Showing 24 changed files with 815 additions and 0 deletions.
45 changes: 45 additions & 0 deletions example_mods/Mods/AbsoluteDeck.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
--- STEAMODDED HEADER
--- MOD_NAME: Absolute Deck
--- MOD_ID: AbsoluteDeck
--- MOD_AUTHOR: [Steamo]
--- MOD_DESCRIPTION: Absolute Deck of PolyGlass!

----------------------------------------------
------------MOD CODE -------------------------

local Backapply_to_runRef = Back.apply_to_run
function Back.apply_to_run(arg_56_0)
Backapply_to_runRef(arg_56_0)

if arg_56_0.effect.config.polyglass then
G.E_MANAGER:add_event(Event({
func = function()
for iter_57_0 = #G.playing_cards, 1, -1 do
sendDebugMessage(G.playing_cards[iter_57_0].base.id)

G.playing_cards[iter_57_0]:set_ability(G.P_CENTERS.m_glass)
G.playing_cards[iter_57_0]:set_edition({
polychrome = true
}, true, true)
end

return true
end
}))
end
end

local loc_def = {
["name"]="Absolute Deck",
["text"]={
[1]="Start with a Deck",
[2]="full of",
[3]="{C:attention,T:e_polychrome}Poly{}{C:red,T:m_glass}glass{} cards"
},
}

local absolute = SMODS.Deck:new("Absolute Deck", "absolute", {polyglass = true}, {x = 0, y = 3}, loc_def)
absolute:register()

----------------------------------------------
------------MOD CODE END----------------------
16 changes: 16 additions & 0 deletions example_mods/Mods/AchievementsEnabler.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- STEAMODDED HEADER
--- MOD_NAME: Achievements Enabler
--- MOD_ID: AchievementsEnabler
--- MOD_AUTHOR: [Steamo]
--- MOD_DESCRIPTION: Mod to activate Achievements

----------------------------------------------
------------MOD CODE -------------------------

function SMODS.INIT.AchievementsEnabler()
sendDebugMessage("AchievementsEnabler Activated!")
G.F_NO_ACHIEVEMENTS = false
end

----------------------------------------------
------------MOD CODE END----------------------
46 changes: 46 additions & 0 deletions example_mods/Mods/DeckOf4s.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
--- STEAMODDED HEADER
--- MOD_NAME: Deck of 4
--- MOD_ID: DeckOf4
--- MOD_AUTHOR: [Steamo]
--- MOD_DESCRIPTION: Create a special deck that only contains 4s!

----------------------------------------------
------------MOD CODE -------------------------

local Backapply_to_runRef = Back.apply_to_run
function Back.apply_to_run(arg_56_0)
Backapply_to_runRef(arg_56_0)

if arg_56_0.effect.config.only_one_rank then
G.E_MANAGER:add_event(Event({
func = function()
for iter_57_0 = #G.playing_cards, 1, -1 do
sendDebugMessage(G.playing_cards[iter_57_0].base.id)
if G.playing_cards[iter_57_0].base.id ~= 4 then
local suit = string.sub(G.playing_cards[iter_57_0].base.suit, 1, 1) .. "_"
local rank = "4"

G.playing_cards[iter_57_0]:set_base(G.P_CARDS[suit .. rank])
end
end

return true
end
}))
end
end

local loc_def = {
["name"]="Deck of fours",
["text"]={
[1]="Start with a Deck",
[2]="full of",
[3]="{C:attention}Fours{}"
},
}

local dfours = SMODS.Deck:new("Deck of fours", "fours", {only_one_rank = 4}, {x = 1, y = 3}, loc_def)
dfours:register()

----------------------------------------------
------------MOD CODE END----------------------
31 changes: 31 additions & 0 deletions example_mods/Mods/EscapeExitButton.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--- STEAMODDED HEADER
--- MOD_NAME: Escape Exit Button
--- MOD_ID: EscapeExitButton
--- MOD_AUTHOR: [Steamo]
--- MOD_DESCRIPTION: Add an "Exit" button into the "Escape" menu

----------------------------------------------
------------MOD CODE -------------------------

function G.FUNCS.exit_button(arg_736_0)
G.SETTINGS.paused = true

love.event.quit()
end

local createOptionsRef = create_UIBox_options
function create_UIBox_options()
contents = createOptionsRef()
local exit_button = UIBox_button({
minw = 5,
button = "exit_button",
label = {
"Exit Game"
}
})
table.insert(contents.nodes[1].nodes[1].nodes[1].nodes, #contents.nodes[1].nodes[1].nodes[1].nodes + 1, exit_button)
return contents
end

----------------------------------------------
------------MOD CODE END----------------------
188 changes: 188 additions & 0 deletions example_mods/Mods/FiveOfAFlush/FOAF_ops.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
--- STEAMODDED HEADER
--- SECONDARY MOD FILE

----------------------------------------------
------------MOD CODE--------------------------

-- Modification from Steamo
-- Only Modify returned objects
local evaluate_poker_handRef = evaluate_poker_hand
function evaluate_poker_hand(arg_182_0)
rvalue = evaluate_poker_handRef(arg_182_0)
rvalue["Five of a Flush"] = {}

if next(get_X_same(5, arg_182_0)) and next(get_flush(arg_182_0)) then
rvalue["Five of a Flush"] = get_X_same(5, arg_182_0)

if not rvalue.top then
rvalue.top = rvalue["Five of a Flush"]
end
end

return rvalue
end

-- Modification from Steamo
-- Only Modify returned objects
local GFUNCSget_poker_hand_infoRef = G.FUNCS.get_poker_hand_info
function G.FUNCS.get_poker_hand_info(arg_540_0)
rvar_540_2, rvar_540_4, rvar_540_0, rvar_540_1 = GFUNCSget_poker_hand_infoRef(arg_540_0)

if next(rvar_540_0["Five of a Flush"]) then
rvar_540_2 = "Five of a Flush"
rvar_540_1 = rvar_540_0["Five of a Flush"][1]
end

return rvar_540_2, rvar_540_2, rvar_540_0, rvar_540_1
end

-- Modification from Steamo
-- Only Modify returned object
local ingameobjRef = Game.init_game_object;
function Game.init_game_object(arg_291_0)
local gameObj = ingameobjRef(arg_291_0)
gameObj.hands["Five of a Flush"] = {
l_chips = 25,
chips = 250,
played = 0,
mult = 25,
visible = false,
l_mult = 3,
level = 1,
description = {
"5 cards with the same rank and suit"
},
example = {
{
"S_A",
true
},
{
"S_A",
true
},
{
"S_A",
true
},
{
"S_A",
true
},
{
"S_A",
true
}
}
}
return gameObj;
end

-- Modification from Steamo
-- Only Modify returned object
local globalsRef = Game.set_globals;
function Game.set_globals(arg_337_0)
globalsRef(arg_337_0)
table.insert(arg_337_0.handlist[1], 1, "Five of a Flush")
end

-- Modification from Steamo
-- Only Modify returned object
local create_UIBox_current_handsRef = create_UIBox_current_hands
function create_UIBox_current_hands(arg_457_0)
local uitable = create_UIBox_current_handsRef(arg_457_0)
local box = create_UIBox_current_hand_row("Five of a Flush", arg_457_0)

table.insert(uitable.nodes[1].nodes, 1, box)
return uitable
end

-- Make Vulcan a "Planet?"
-- Modification from Steamo
-- Only Modify returned object
local GUIDEFcard_h_popupRef = G.UIDEF.card_h_popup
function G.UIDEF.card_h_popup(arg_414_0, arg_414_1)
local obj = GUIDEFcard_h_popupRef(arg_414_0, arg_414_1)

if arg_414_0.ability.name == "Vulcan" then
obj.nodes[1].nodes[1].nodes[1].nodes[3] = create_badge(localize("k_planet_q"), get_type_colour(arg_414_0.config.center, arg_414_0))
end

return obj
end


-- Add to collection
-- Will be reworked when added to the API
function create_UIBox_your_collection_planets()
local var_469_0 = {}

G.your_collection = {}

for iter_469_0 = 1, 2 do
G.your_collection[iter_469_0] = CardArea(G.ROOM.T.x + 0.2 * G.ROOM.T.w / 2, G.ROOM.T.h, 6.25 * G.CARD_W, 1 * G.CARD_H, {
highlight_limit = 0,
collection = true,
type = "title",
card_limit = 6
})

table.insert(var_469_0, {
n = G.UIT.R,
config = {
no_fill = true,
align = "cm",
padding = 0
},
nodes = {
{
n = G.UIT.O,
config = {
object = G.your_collection[iter_469_0]
}
}
}
})
end

for iter_469_1 = 1, #G.your_collection do
for iter_469_2 = 1, 6 do
local var_469_1 = G.P_CENTER_POOLS.Planet[iter_469_2 + (iter_469_1 - 1) * 6]
local var_469_2 = Card(G.your_collection[iter_469_1].T.x + G.your_collection[iter_469_1].T.w / 2, G.your_collection[iter_469_1].T.y, G.CARD_W, G.CARD_H, nil, var_469_1)

var_469_2:start_materialize(nil, iter_469_2 > 1 or iter_469_1 > 1)
G.your_collection[iter_469_1]:emplace(var_469_2)
end
end

INIT_COLLECTION_CARD_ALERTS()

return (create_UIBox_generic_options({
back_func = "your_collection",
contents = {
{
n = G.UIT.R,
config = {
emboss = 0.05,
r = 0.1,
minw = 2.5,
align = "cm",
padding = 0.1,
colour = G.C.BLACK
},
nodes = var_469_0
},
{
n = G.UIT.R,
config = {
padding = 0,
align = "cm"
},
nodes = {}
}
}
}))
end

----------------------------------------------
------------MOD CODE END----------------------
3 changes: 3 additions & 0 deletions example_mods/Mods/FiveOfAFlush/FOAF_ops.lua:Zone.Identifier
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
HostUrl=https://cdn.discordapp.com/attachments/1168219372003790850/1184248696204968046/FiveOfAFlush.lua?ex=658b488b&is=6578d38b&hm=f4a8dcf07984ba47458e447af1ca947fefcfc02a0fb52226b0915385434cbb50&
Loading

0 comments on commit b2299f5

Please sign in to comment.