[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Progress update.
The back-end for the damage calculator is done. The code is one of the
nastiest kludges I've ever written in my life, but it works. More than
that, it even implements _all_ of the damage rules in Millennium's End,
save for one rule which I have never liked at all--and since I'm the guy
writing the code, too bad, it's not going in.
If you really decide you can't live without knowing precisely when a limb
gets severed from gunfire, you're free to change the code. :)
My testing dummy is named Charles, by the way. Yes, Charles Ryan. It's
not meant as a slam against him, and I hope the real Charles has a good
enough sense of humor to laugh a bit at it. :)
Anyway. This is output directly from the damage calculator.
(It may help if you view this message in a proportional, fixed-width font.
It's much more appealing to the eye that way.)
=====
Shooting Charles in the head with 9mm FMJ...
Trauma level = 25
Impairment to mental skills = 0
to all physical skills = 0
to his right arm = 0
to his left arm = 0
to his right leg = 0
to his left leg = 0
stun roll modifier = 0
Is he in shock? no
Is a bone broken? no
Is he bleeding to death? no
Is he an ex-parrot? 'e's shuffled off the twig!
Healing Charles... he feels much better now.
Shooting Charles in the right torso with 9mm FMJ...
Trauma level = 24
Impairment to mental skills = 0
to all physical skills = 49
to his right arm = 49
to his left arm = 49
to his right leg = 49
to his left leg = 49
stun roll modifier = 15
Is he in shock? yes
Is a bone broken? yes
Is he bleeding to death? yes
bleed rate = 1
Is he an ex-parrot? See? 'E just moved!
Healing Charles... he feels much better now.
Shooting Charles in the right thigh with .380 FMJ...
Trauma level = 13
Impairment to mental skills = 0
to all physical skills = 0
to his right arm = 0
to his left arm = 0
to his right leg = 31
to his left leg = 31
stun roll modifier = 65
Is he in shock? no
Is a bone broken? yes
Is he bleeding to death? yes
bleed rate = 18
Is he an ex-parrot? See? 'E just moved!
=====
Please, guys, sanity-check this output. If there are bugs in how I'm
evaluating damage, I want to find out about it now as opposed to later.
I'm hoping that we can have the damage calculator completely done and in
ship-shape form by the time GCUK rolls around. With any luck, the guys
who are running ME @ GCUK will find it useful.
=====
Warning: Geek Programmer Stuff follows.
The API:
... The API itself is pretty clean, although the code behind it is worthy
of Microsoft. Creating a new character object is as simple as:
// BEOp = BlackEagle Operative
BEOp CharlesRyan;
Setting attributes is straightforward:
// Set Charles' Strength attribute to 45
CharlesRyan.setAttr(BEOp::STR, 45);
Hurting people is just as easy:
// Charles is standing too close to a flashbang when it goes off.
CharlesRyan.hurt(Wounds::HEAD, 12, Wounds::CONCUSSION);
// Or he catches a knife in the ribs.
CharlesRyan.hurt(Wounds::RT_VITALS, 7, Wounds::PUNCTURE);
// Since players get shot so much, if you omit the final parameter,
// it assumes they're getting shot. In this case, by a DD 18 9mm Para.
CharlesRyan.hurt(Wounds::RT_LOWERARM, 18);
// You can fetch an object that stores all of Charles' wound information
Wounds this_hurts = CharlesRyan.status();
// And you can use it to get very specific damage information.
// Is Charles in shock?
this_hurts.inShock();
// Is he bleeding to death?
this_hurts.isBleeding();
// Did that 9mm break his arm?
this_hurts.getDamage(Wounds::RT_LOWERARM).isBroken()
// How hard is it for him to think clearly?
this_hurts.getImpairment(Wounds::MENTAL);
// How hard is it for him to do general physical actions?
this_hurts.getImpairment(Wounds::PHYSICAL);
// How badly impaired is his arm?
this_hurts.getImpairment(Wounds::LT_ARM);
// Now cap him with a .40 S&W.
CharlesRyan.hurt(Wounds::HEAD, 18);
// Is Charles dead?
this_hurts.isDead();
// Not for long.
CharlesRyan.heal();
=====
I'm going to be out of town this upcoming weekend. Will try to get some
work done on it when I can, but no guarantees.
Total size of the executable, by the way... 37k.
Nabad for a day or so's frenzied work, eh? :)
--
Geek Code: GAT d- s+:+ a27 C++(+++)$ ULB++>++++ P++ L+++>++++ E W+ N+ w
PS+ PE++ Y++ PGP++ t+ 5++ X-- R tv b+++ DI++ D--- G+ e++ h*
r* y+*