consistency, encapsulation and flexibility.
For real? Ok then. Anyone with a genuine interest in this stuff:
Is it so far fetched to think that they have some Luck formula involved or some other shit?
That depends on the "so" in "so far fetched." But it would be naive and harmful, for many reasons.
The heart of OOP is
encapsulation keeping things intuitive, logical, and distinct, and not going at it like a phantom-shitter with a penchant for booby-traps.
Each object is responsible for its own information and actions.
Crossover should should take place at at a level / within an object which is
- high enough that it can or does contain or reference all the sources
- low enough that it can be used in all the necessary scenarios and contexts
- somewhere between those as to reflect "real world" relationships and actions
People w/ Luck use Weapons. Weapons can Jam when used. Jams involve the Weapon. Weapons can have Mods. Mods use getBonus() to provide Mod info. Doing otherwise creates many issues, for no reason.
- Mod info adjusted by other things, is no longer info about the Mod. Info you need, to show in the inventory, and for when you must recalculate.
- Jam code at the Mod-level increases a Mod's complexity. But Mods don't Jam. They're just numbers relevant to Weapon use.
- Splitting a calculation up and scattering it, obscures it. The Jam system is no longer controlled where it "happens." The definition of a Mod now contains critical logic, specific to Jams, People, and Luck.
- Apply Luck per input, and it must be done for all potential inputs. The above problems are exacerbated.
One piece of logic, split in two, invoked three places, running four times, to do one thing.... for a total of infinite headache potential, zero mathematical difference, one inevitable murder-suicide, and several (very ignorable) performance hits.
Minor downsides. But ones created for no reason, while deftly avoiding most of the upsides of OOP.
That little part of tiny code is unoptimized. That is obvious.
Before changing working code to be more "optimized" it helps to ask:
- Would it impact performance in a meaningful way?
- Would it avoid introducing unwanted complexity?
- Would it be a clean, acceptable trade, without hidden cost?
- No. Once or twice per turn -- "hundreds" to "hundreds of thousands" of frames -- we read four non-decimal numbers from an object in memory, and take their sum. You could almost keep up on pen and paper.
- No. The computed value must be specifically recalculated each time it could change. Timeless RPG bug: equipment effects that refuse to apply or remove if things don't go "just right."
- No. Storing the sum, for each weapon on the field, consumes memory across all frames. Logic to calculate and store as-needed, could cause more impact than it avoids.
In this case, going past Step 1 is a waste of time. Even getting TO Step 1 is a waste of time. There is
X happening each frame to figure out what you're pointing at, where X is way greater than adding four numbers together when you click.
I didn't say that the entire source code is like that but of course you are too fucking retarded to think for a second.
I didn't say I thought you said that, so you should have thought for a second before thinking, you, you -- you
great big meanie.
I said I thought you say some awfully bold shit, about other people not knowing what they're talking about, for that talking, about what you're not knowing.