Skip to content

Instantly share code, notes, and snippets.

@lincoln-lm
Created January 15, 2023 21:35
Show Gist options
  • Select an option

  • Save lincoln-lm/d2a9239910e71c8f9e9d71f48e092af2 to your computer and use it in GitHub Desktop.

Select an option

Save lincoln-lm/d2a9239910e71c8f9e9d71f48e092af2 to your computer and use it in GitHub Desktop.
sv mark generation lua function
-- Time
local Time_DayDawn = 0
local Time_Dusk = 1
local Time_Night = 2
-- Weather
local Weather_None = 0
local Weather_Cloudy = 1
local Weather_Rainy = 2
local Weather_Stormy = 3
local Weather_Snowy = 4
local Weather_Blizzard = 5
local Weather_Dry = 6
local Weather_Sandstorm = 7
local Weather_Misty = 8
-- Marks
local Mark_Lunchtime = 53
local Mark_SleepyTime = 54
local Mark_Dusk = 55
local Mark_Dawn = 56
local Mark_Cloudy = 57
local Mark_Rainy = 58
local Mark_Stormy = 59
local Mark_Snowy = 60
local Mark_Blizzard = 61
local Mark_Dry = 62
local Mark_Sandstorm = 63
local Mark_Misty = 64
local Mark_Destiny = 65
local Mark_Fishing = 66
local Mark_Curry = 67
local Mark_Uncommon = 68
local Mark_Rare = 69
local Mark_Rowdy = 70
local Mark_AbsentMinded = 71
local Mark_Jittery = 72
local Mark_Excited = 73
local Mark_Charismatic = 74
local Mark_Calmness = 75
local Mark_Intense = 76
local Mark_ZonedOut = 77
local Mark_Joyful = 78
local Mark_Angry = 79
local Mark_Smiley = 80
local Mark_Teary = 81
local Mark_Upbeat = 82
local Mark_Peeved = 83
local Mark_Intellectual = 84
local Mark_Ferocious = 85
local Mark_Crafty = 86
local Mark_Scowling = 87
local Mark_Kindly = 88
local Mark_Flustered = 89
local Mark_PumpedUp = 90
local Mark_ZeroEnergy = 91
local Mark_Prideful = 92
local Mark_Unsure = 93
local Mark_Humble = 94
local Mark_Thorny = 95
local Mark_Vigor = 96
local Mark_Slump = 97
local Mark_None = -1
function LotRibbon(arg0)
local rand_val, weather, time_period, current_hour
-- fDAAAA586 appears to be some form of rand(minimum, maximum) of [minimum, maximum]
rand_val = arg0.fDAAAA586(0, 999)
-- 1/1000
if 0 == rand_val then
return Mark_Rare
-- 10/1000
elseif rand_val >= 1 and rand_val <= 10 then
-- random personality mark
-- 1/28 per
return 70 + arg0.fDAAAA586(0, 27)
-- 20/1000
elseif rand_val >= 11 and rand_val <= 30 then
return Mark_Uncommon
-- 40/1000
elseif rand_val >= 31 and rand_val <= 70 then
if C2B428A63695FD2C7.CheckBirthday() then
return Mark_Destiny
end
-- 20/1000
elseif rand_val >= 71 and rand_val <= 90 then
weather = main.env.weather.WeatherManager.s_impl[5].type
if Weather_Cloudy == weather then
return Mark_Cloudy
elseif Weather_Rainy == weather then
return Mark_Rainy
elseif Weather_Stormy == weather then
return Mark_Stormy
elseif Weather_Snowy == weather then
return Mark_Snowy
elseif Weather_Blizzard == weather then
return Mark_Blizzard
elseif Weather_Sandstorm == weather then
return Mark_Sandstorm
elseif Weather_Misty == weather then
return Mark_Misty
end
-- 20/1000
elseif rand_val >= 91 and rand_val <= 110 then
time_period = main.system.game_time.GameTimeManager.s_impl.F36837B48B38D4857(
main.system.game_time.GameTimeManager.s_impl,
main.system.game_time.GameTimeManager.s_impl[5].gameTime
)
if time_period == Time_DayDawn then
function getSecondInDay()
local current_second
current_second = nil
if main.system.game_time.GameTimeManager.s_impl[5] ~= main.system.game_time.GameTimeManager.s_impl[4] then
current_second = main.system.game_time.GameTimeManager.s_impl[5].gameTime
else
current_second = main.system.game_time.GameTimeManager.s_impl.F8C8B225CB8805704(
main.system.game_time.GameTimeManager.s_impl,
main.system.game_time.GameTimeManager.s_impl[5].gameTime
)
end
return current_second
end
current_hour = getSecondInDay() / 3600
if current_hour >= 12 and current_hour < 18 then
return Mark_Lunchtime
else
return Mark_Dawn
end
elseif time_period == Time_Dusk then
return Mark_Dusk
elseif time_period == Time_Night then
return Mark_SleepyTime
end
end
return Mark_None
end
@lincoln-lm
Copy link
Copy Markdown
Author

Easy to read table containing this rate information as well as when the title powers are applied courtesy of Anubis:

https://mobile.twitter.com/Sibuna_Switch/status/1625345500869271553
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment