diff --git a/res/construction/weirdcard.con b/res/construction/weirdcard.con new file mode 100644 index 0000000..523ffb0 --- /dev/null +++ b/res/construction/weirdcard.con @@ -0,0 +1,123 @@ +function data() + local assets = { + -- Because your empire of buildings clearly needs variety... or at least different shades of grey. + "building/era_c/res_4_2x2_01.mdl", + "building/era_c/res_4_2x3_01.mdl", + "building/era_c/res_4_2x3_02.mdl", + "building/era_c/res_4_2x3_03.mdl", + "building/era_c/res_4_3x3_01.mdl", + "building/era_c/res_4_3x3_02.mdl", + "building/era_c/res_4_3x3_03.mdl", + "building/era_c/res_4_3x4_01.mdl", + "building/era_c/res_4_3x4_02.mdl", + "building/era_c/res_4_3x4_03.mdl", + "building/era_c/res_4_4x4_01.mdl", + "building/era_c/res_4_4x4_02.mdl", + "building/era_c/res_4_4x4_03.mdl" + } + + return { + type = "ASSET_DEFAULT", + description = { + name = _("Weirdcard Asset"), + description = _("Experience the highs and lows of Weirdcard financial wizardry."), + }, + availability = {}, + buildMode = "MULTI", + categories = { "misc" }, + order = 1, + skipCollision = true, + autoRemovable = true, + params = { + { + key = "weirdcard_mio", + name = _("Investment / Dividend:"), + uiType = "SLIDER", + values = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }, + defaultIndex = 0, + tooltip = _("Select how many millions you want to magically appear or vanish in true Weirdcard fashion.") + }, + { + key = "weirdcard_faktor", + name = _("Investment method:"), + uiType = "COMBOBOX", + values = { _("Cautious +1"), _("Adventurous +10"), _("Speculative +100"), _("Oligarch +1000") }, + defaultIndex = 0, + tooltip = _("Choose your risk level. The higher the factor, the greater the reward or loss!") + }, + { + key = "weirdcard_p_m", + name = _("Burn Money and Documents"), + uiType = "CHECKBOX", + values = { "Loss", "Profit" }, + defaultIndex = 0, + tooltip = _("Check 'Loss' to watch your assets go up in flames, just like those pesky auditing reports.") + }, + { + key = "weirdcard_intpol", + name = _("Wanted by Interpol"), + uiType = "CHECKBOX", + values = { "Yes", "No" }, + defaultIndex = 0, + tooltip = _("Tick 'Yes' if you'd like to live life on the edge and become the star in an international manhunt!") + }, + { + key = "weirdcard_eventFrequency", + name = _("Event Frequency"), + uiType = "COMBOBOX", + values = { "Rare", "Uncommon", "Common", "Frequent" }, + defaultIndex = 1, + tooltip = _("Adjust how often random money events occur.") + }, + { + key = "weirdcard_dailyIncome", + name = _("Daily Income"), + uiType = "COMBOBOX", + values = { _("0"), _("1K"), _("10K"), _("100K") }, + defaultIndex = 0, + tooltip = _("Set a daily money bonus for continuous growth.") + }, + }, + + updateFn = function(params) + local result = {} + + -- Randomly pick a building model because choosing one is too much commitment. + local modelIndex = math.random(1, #assets) + result.models = { + { + id = assets[modelIndex], + transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 } + } + } + + -- Terrain adjustment logic, because no one likes jagged, unruly landscapes. + result.terrainAlignmentLists = { { + type = "EQUAL", + faces = {} + } } + + -- Calculate the cost, because crashing economies is what we do best. + local p_m = -1 + if params.weirdcard_p_m == 1 then + p_m = 1 + end + + local faktor = { 1, 10, 100, 1000 } + result.cost = (params.weirdcard_mio + 1) * faktor[params.weirdcard_faktor + 1] * 1000000 * p_m + result.bulldozeCost = 0 + result.maintenanceCost = 0 + + -- Add daily income to keep the virtual economy spinning, or collapsing... + local dailyIncomeValues = {0, 1000, 10000, 100000} + local dailyIncome = dailyIncomeValues[params.weirdcard_dailyIncome + 1] + + -- Simulate daily income adjustment, because stability is so last season. + if dailyIncome > 0 then + result.cost = result.cost - dailyIncome + end + + return result + end + } +end \ No newline at end of file