Found this on my PC dated to October 2019, a design doc for what is basically a luck stat that would interact with the game in minor fun ways. I had forgotten all about this but I figure I might as well share it
main thing:
- all mobs now have a luck component that primarily stores a luck value (an int from -100 to 100).
by default, this value is 0.
- generally, positive luck should not have a combat advantage (if it does, it should be very minimal).
negative luck, however, should have major combat disadvantages.
helper procs:
- getluck(): checks if an atom has a luck component. if it does not, return the luck as 0.
if it does, return the luck value.
- addluck(x): add x to luck value
- setluck(x): set luck value to x
- probluck(x): a prob() check where luck is flat added onto the end. IE: probluck(50) with a mob that has 10 luck
is the same as prob(60). min cap 0, upper cap 100
Examples:
- chance of getting a good event in orion trail
- chance of succeeding in a risky surgery operation
- lucksave(x, y): a prob() check where luck has a chance of being flat added. y is the prob of luck being added.
by default, this value is set to luck, so 1 luck = 1/100 chance of 1 being added to a prob. (maybe make this
an algorithm...) good for dice rolls or other things with small values.
Examples:
- literal ingame dice rolls (maybe not die of fate though)
- chance to not drop things when you cough
- chance to bump roulette wheel towards your chosen number
- chance for flash to not burn out if it would have
- chance that you get stun punched (negative luck only)
- getLucky(): equal to prob([luck value]). used for things where no prob previously existed.
Examples:
- orion trail glitches in your favor and grants free resources
- "You slip on the water, but do a backflip and land on your feet!"
- chance of avoiding appendictus (it gets passed to the next guy)
- "Despite saying that you lost, the slot machine still spits out a coin. How fortunate!"
- getUnlucky(): if your luck is negative, this is prob(|[luck value]|). outputs should be bad
Examples:
- your arcade machine freezes in the middle of your game, so you have to reboot it and lose progress
- "The slot machine starts to pay out your winnings, but the coin slot gets jammed..."
- "The airlock doesn't notice you, and you bump headfirst into it. Ow..."
- nanotrasen paycheck error means you dont get paid this cycle
- slipping makes things fall out of your pockets, will activate any dropped grenades
- getting up from a slip will make you slip *again*
- harvesting plants has a lower yield, x* smaller yield for clovers where x is |your luck| (min 0).
- you have a chance to screw up (de)construction steps of basic things like walls and windows
- your gun jams and is disabled for a few seconds
- when you throw something you accidentally only throw it a tile ahead
- your voice can crack mid-sentence, giving you a wacky font
- spells you cast misfire (like what happens when you read a used spellbook)
- getting stunned can knock your shoes off
- burn damage will ignite you
other examples:
- prob(min(0, max((victim.getluck() - attacker.getluck())), 10))//prob(your luck - their luck) min 0 max 10
"[attacker] swings to punch you, but misses and hits [him/her]self instead!"
- //die of fate
roll = rand(1,20)
if(roller.getUnlucky())
roll += roller.getluck
roll = min(1, roll)
else if(roller.getLucky())
roll += floor(roller.getluck()/10)
roll = max(20, roll)
luck modifiers:
- lucky trait: +3 luck
- unlucky trait: -3 luck
- break a mirror: -7 luck for 7 minutes
- add a boon/punishment admins can do on prayers that give/remove luck.
- being a bit drunk/high makes you luckier, being blackout drunk/hallucinating makes you un-luckier
- new alcohol that specifically raises your luck by a slight extra amount, a second new alcohol that lowers it
- (lavaland?) cursed amulet of luck: you can choose to either permanently gain +30 luck at the cost of taking 5% more damage, or take 5% less at the cost of -30 luck
- corgi paw necklace: get a corgi paw by butchering a corgi. add it to a necklace chain to make a necklace.
making the necklace gives you a curse of -5 luck, but wearing it gives +5 luck.
- new plant, clovers, can be eaten for a status effect that gives luck. if you have luck, they have a chance
of being x-leafed (x = 3 + luck), giving 2x the luck.
- green beers and clover cakes can be made that give a stronger version of the effect that stacks with the first
- devils are very lucky (+50), and their contracts can steal luck from whoever signs them. this would
siphon 5(?) luck.
- wizards can see luck on examine, and can buy an amulet of extreme luck that gives a flat buff to luck (+50?)
and prevents all luck loss. goes in necklace slot.
- chaplains smacking you with a bible blesses you with better luck for a short time
- summon event that applies a status effect on all mobs that modifies sets luck to a random amount for a decent time.
("You feel as though your destiny has slipped away...")
- wand of misfortune, which gives the victim a 1 minute debuff that sets their luck to -100
- lavaland reward: miracle cream. 5-use item that
gives a 30 second buff of +100 luck (and a random genetics power?).
other additions:
- new span class that's like notify but green, for when lucky things happen to you
I've always really liked the idea, it's just come with the understanding that the code cost of implementing it is huge and repository wide which sucks. you have to manually sort every probability into something that can be lucky and based off of someone and a probability that should be immutable
Armhulen wrote:I've always really liked the idea, it's just come with the understanding that the code cost of implementing it is huge and repository wide which sucks. you have to manually sort every probability into something that can be lucky and based off of someone and a probability that should be immutable
The doc pretty much says it should only actually take luck into consideration on a few select things, but yeah you would have to pretty much comb through a lot of prob() calls to see where it would fit in
PKPenguin321 wrote:Found this on my PC dated to October 2019, a design doc for what is basically a luck stat that would interact with the game in minor fun ways. I had forgotten all about this but I figure I might as well share it
main thing:
- all mobs now have a luck component that primarily stores a luck value (an int from -100 to 100).
by default, this value is 0.
- generally, positive luck should not have a combat advantage (if it does, it should be very minimal).
negative luck, however, should have major combat disadvantages.
helper procs:
- getluck(): checks if an atom has a luck component. if it does not, return the luck as 0.
if it does, return the luck value.
- addluck(x): add x to luck value
- setluck(x): set luck value to x
- probluck(x): a prob() check where luck is flat added onto the end. IE: probluck(50) with a mob that has 10 luck
is the same as prob(60). min cap 0, upper cap 100
Examples:
- chance of getting a good event in orion trail
- chance of succeeding in a risky surgery operation
- lucksave(x, y): a prob() check where luck has a chance of being flat added. y is the prob of luck being added.
by default, this value is set to luck, so 1 luck = 1/100 chance of 1 being added to a prob. (maybe make this
an algorithm...) good for dice rolls or other things with small values.
Examples:
- literal ingame dice rolls (maybe not die of fate though)
- chance to not drop things when you cough
- chance to bump roulette wheel towards your chosen number
- chance for flash to not burn out if it would have
- chance that you get stun punched (negative luck only)
- getLucky(): equal to prob([luck value]). used for things where no prob previously existed.
Examples:
- orion trail glitches in your favor and grants free resources
- "You slip on the water, but do a backflip and land on your feet!"
- chance of avoiding appendictus (it gets passed to the next guy)
- "Despite saying that you lost, the slot machine still spits out a coin. How fortunate!"
- getUnlucky(): if your luck is negative, this is prob(|[luck value]|). outputs should be bad
Examples:
- your arcade machine freezes in the middle of your game, so you have to reboot it and lose progress
- "The slot machine starts to pay out your winnings, but the coin slot gets jammed..."
- "The airlock doesn't notice you, and you bump headfirst into it. Ow..."
- nanotrasen paycheck error means you dont get paid this cycle
- slipping makes things fall out of your pockets, will activate any dropped grenades
- getting up from a slip will make you slip *again*
- harvesting plants has a lower yield, x* smaller yield for clovers where x is |your luck| (min 0).
- you have a chance to screw up (de)construction steps of basic things like walls and windows
- your gun jams and is disabled for a few seconds
- when you throw something you accidentally only throw it a tile ahead
- your voice can crack mid-sentence, giving you a wacky font
- spells you cast misfire (like what happens when you read a used spellbook)
- getting stunned can knock your shoes off
- burn damage will ignite you
other examples:
- prob(min(0, max((victim.getluck() - attacker.getluck())), 10))//prob(your luck - their luck) min 0 max 10
"[attacker] swings to punch you, but misses and hits [him/her]self instead!"
- //die of fate
roll = rand(1,20)
if(roller.getUnlucky())
roll += roller.getluck
roll = min(1, roll)
else if(roller.getLucky())
roll += floor(roller.getluck()/10)
roll = max(20, roll)
luck modifiers:
- lucky trait: +3 luck
- unlucky trait: -3 luck
- break a mirror: -7 luck for 7 minutes
- add a boon/punishment admins can do on prayers that give/remove luck.
- being a bit drunk/high makes you luckier, being blackout drunk/hallucinating makes you un-luckier
- new alcohol that specifically raises your luck by a slight extra amount, a second new alcohol that lowers it
- (lavaland?) cursed amulet of luck: you can choose to either permanently gain +30 luck at the cost of taking 5% more damage, or take 5% less at the cost of -30 luck
- corgi paw necklace: get a corgi paw by butchering a corgi. add it to a necklace chain to make a necklace.
making the necklace gives you a curse of -5 luck, but wearing it gives +5 luck.
- new plant, clovers, can be eaten for a status effect that gives luck. if you have luck, they have a chance
of being x-leafed (x = 3 + luck), giving 2x the luck.
- green beers and clover cakes can be made that give a stronger version of the effect that stacks with the first
- devils are very lucky (+50), and their contracts can steal luck from whoever signs them. this would
siphon 5(?) luck.
- wizards can see luck on examine, and can buy an amulet of extreme luck that gives a flat buff to luck (+50?)
and prevents all luck loss. goes in necklace slot.
- chaplains smacking you with a bible blesses you with better luck for a short time
- summon event that applies a status effect on all mobs that modifies sets luck to a random amount for a decent time.
("You feel as though your destiny has slipped away...")
- wand of misfortune, which gives the victim a 1 minute debuff that sets their luck to -100
- lavaland reward: miracle cream. 5-use item that
gives a 30 second buff of +100 luck (and a random genetics power?).
other additions:
- new span class that's like notify but green, for when lucky things happen to you
Oh man I'd totally be the dude who when the long shift gets boring makes 1000 corgi paws just to get trolled by the game. Sounds like a fun time
► Show Spoiler
ThanatosRa wrote:My biggest problem is that I can't fix any of this.
Boris wrote:shadowflame either has a brain the size of a pea or one the size of the moon and he's playing 58D chess.
BeeSting12 wrote:please write an apology to this forums, this community, the host, and the internet as a whole for the data storage space you wasted with this complaint.
BebeYoshi wrote:Saltyflame909
Cobby wrote:The trash bin... have you lost your way home anon?
Shaps-cloud wrote: ↑Mon Dec 07, 2020 7:59 am
May eventually become one of the illusive maintainer-headmins if they choose to pursue that path, having a coder in the senior admin leadership has usually been positive for both sides in the past.
Farquaar wrote: ↑Sun Nov 21, 2021 11:43 pm
Imagine my grandparents surviving nazi concentration camps only for their grandson to be accused of nazism for criticizing a citrus fruit on the internet.