Jump to content

The Legacy of Emperors

Photo

New Weapon System (Alpha) v2


  • Please log in to reply
No replies to this topic

#1 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 20 May 2014 - 08:38 AM

The 'New Weapon System', is at Alpha-2 stage:

Downloads:

You can download the .qst file here:

v0,63r50sZ5.qst

I'll be releasing the current scripts as a complete set, in one ZIP archive in a few days.


New Weapon Damage System:

This replaces normal weapon damage (power) with a value rolled at random, using ;virtual dice'. The currenct value is stored in the global int currentDamage, that is updated each time the player uses a weapon that operates on this value, to prevent breaking the game. (i.e. A weapon that uses this, will not operate on the damage of a previous weapon that set it. Each use of a weapon that uses this value, changes it, when the player uses the weapon, updating its value on each, and every use.

Weapon damage rolled using random die rolls, with the following options:
rollDie(dieType)
 
Examples:
 
rollDie(8) rolls 1d8 (Rand, values 1-to-8)
rollDie(100), rolls 1d100 (Rand, values 1-to-100)

Rolls one die, of a specific type.
rollDice(numberOfDice, dieTypes); // Rolls x dice (numberOfDice), of type (dieType).
 
Examples:
 
rollDice(3,6); //Rolls 3d6, meaning this rolls three *separate* RollDie(4)---Rand(1,6) ---Rand value 1-to-6 each---and sums the result of all three.
 
rollDice(10,4); //Rolls 10d4, meaning this rolls ten *separate* RollDie(4)---Rand(1,4)---Rand value 1-to-4 each---and sums the result of all ten.

Useful for rolling a specific number of dice, of a singular die type.
Can be stacked by simple addition:
int baseDamage = rollDice(2,8);
int bonusDamage = rollDice(3,4);
int totalDamage = ( baseDamage + bonusDamage );

While you can use rollDice using if statements, to roll damage per level, there is also a function for auto-scaling damage.

Example if statement version:




This (below) is the intended method of using damage that scales by level...

It operates on a game counter [CR_LEVEL], but could use a standard int to track levels.
diePerLevel(dieType, cap); // Rolls 1dX per level, where X is the die type. The argument (cap), if greater than zero, sets the maximum number of dice to roll. Thus, if cap is '10', and the character is level 12, it will roll 10 dice, but if cap is 0, it will roll 12 dice.
 
Example:
 
diePerLevel(4,10); //Rolls 1d4 per level, max 10d4.
diePerlevel(6,0); //Rolls 1d6 per level, no maximum.

This is a 'scaling' function, that for example if used with a spell, rolls dice based on level.

diePerLevel and rollDice scaling modifiers:

While having these functions is all well, and good, on some occasions, you may want to restrict this, by (as an example), rolling 1d4/two levels. That is, a 10th Level character rolling 1d4/2-Levels, would roll 5d4, instead of 10d4.

It works using a global int, that you can adjust to set the divisor, or the multiplication factor. Multiplication is bst, to avoid division by zero, unless you first declare something like this in the item scripts:
int level = Game->Counter[CR_LEVEL];
if ( level == 0 ){
	  level = 1;
}

This allows using division, avoiding div-by-zero complications. (The standard value is * 0.5.)
Each item can set this value, when used, or you can establish it on a per-item basis.

The next stage, is setting up some item-specific statements/variables. I use ints, rather than bools, to avoid typecasting nightmares...
int halfevel; // If set to 0, it's disabled. If set to 1 or greater, it multiples the number of dice by 0.5. (usually, 1/2 level).
int divlevel; //Divides maxDice by an int. Can be problematic, if Level = 0.
int maxDice; //Sets a specific maximum number of dice to roll.

I tend to use these as item args, so that I can share scripts.

Now that you have a general idea of what's going on, let me explain the bigger issues:

This system works with all LWs, including swords, but not without some caveats...


At present, it has the following bugs:

Swords using this system can harm enemies of types that are normally invincible, such as Peahats, and possible some hard-coded enemies, such as Patra cores. I haven't tested it with everything, but I know that it can hard flying Peahats, which is something that I may eventually resolve, unless someone beats be to that.

Sword-beams are a bit glitchy: Collision detection is not 100% effective. Some hits that should register, do not; and some that should not, do. While it tends to respect shields, under some circumstances, striking a shielded enemy may register a hit, even if it doesn't hit an non-shielded spot.

Sword beams don't always die (WDS_DEAD) as intended.

Beam shards (WDS_BEAMSHARDS) are glitchy, in two ways:
  • If using a sword, directly against an enemy, the beamshards will be briefly visible, and can look appalling. I've disabled the beamshard GFX, to avoid seeing this.
  • If beamshards strike certain objects, they can become temporarily stuck, rather then dying, even with beamshards set to be WDS_DEAD.
All this notwithstanding, the system does work!

The latest release (v0,63r60sZ5) has it enabled, with standard single-die weapons, rollDice items, and scaling damage functions (damage per level). You can view download the demo of the system below.

Changes In This Release:

The latest release uses the New Weapon-Damage System (NWS). All swords use this, as do some other items. Swords 2-8 are enabled as init datum, and Sword-1 is on the screen to the right of start, so you can test all of them.

Other LWeapons, now also use this system. I have an error in the gc_firearms_WDS.z script, that is preventing firearms from working, but I'll address that presently.

Scaling damage is working (tested).

Rod of Calmen is enabled, and at present fires a spear. This will eventually be an ice weapon.

Net Planned Changes:

Adjust enemy HP to appropriate values for random roll, and scaling damage.
Adjust XP system to account for new (higher) enemy HP values.

Script Defences (Ghosted Enemies):

The NPCD_SCRIPT# system is included, but not yet ij use (or tested). the intent of this, is to add NPC defence types for each of the ten script types, rather than a single NPCD_SCRIPT, so that weapons can have distinct damage types. The present types are:
  • Sonic
  • Ice/Water
  • Air/Electricity
  • Fire/Heat (technically, a duplicate, as LW_FIRE exists).
  • Earth/Acid (including explosions, and quakes)/
  • Light (against Undead)
  • Darkness (the reverse of 'Light')
  • Nuclear (Proton Pack)
  • Energy Weapon (Stazer, and other planned energy weapons, such as the 'Energy Sword'.)
  • (10: Unused)
Making this work, as planned, will require ghosting every enemy in the game, with an autoghost script, that adds NPCD_SCRIPT_TYPE to the enemy. Script defence types work using the standard category of defence flags, but are as yet, untested.

DigiVolve()

This systsem is partially working, but disabled. As I already need to ghost every enemy, this will work via the same system, and will change enemies into more advanced enemies, when events occur i the game, evolving them, to present a (theoretically) balanced syste over the course of the entire game.

XP System:

I will be adjusting this to use an int, instead of a constant for XP assignments. Further, I will be adding XP awards, for completing challenges.

Other:

Currency System: The currency system is slightly improved, and working. I have yet to add alternqte currency, and more advanced banks.

MIDI FIles: I've added MIDI files to the ;qst file, but none of these are in use at present. I may, or may not use any, or all of them.

Rod of Calmen: AT last, this can be used. It was the last non-functional item, but it still isn't working as planned. The model here, is to produce ice damage, and freeze vulnerable enemies, and to cause terrific damage to fire-based enemies.

Spectral Enemies: Unchanged, but that should soon change.

Timestop: Plans to add enemy types that can only be harmed when frozen.

Detonate: I disabled this for the present, to aid in testing, asit may have been causing a glitch with currendDamage, the global variable used to set weapon damage.

Item Damage: Not all items use the NWS... Bombs, and some other items are not yet scripted.

Sonic Wand: This item now produces two LWs, one is 'magic', for backward-compatibility with 'Magic' secret combos. This LW has a power of 0. It also simultaneously produces a 'sonic' LW at the same position as the 'magic' LW, that i intend to work against enemies with LW_SONIC defences.

Candle (bug): I need to re-script this, as its fire doesn't persist after striking an enemy.

Additional Sword Attributes:

All eight swords are fully scripted, and the scripted damage works with slash, and sword techniques. (I'm not certain is spin-attack doubles the currentDamage.)

Swords also operate on a few conditions:
bool WSpierce : Sets if beam is 'penetrating.
int beamMultiplier : A global int that sets the beam multiplier. Ever weapon can update this to a precise amount. (It should probably be a float.)

Again, this isn't perfect, but I'm making progress.

Lore Checks (and other Skill Checks):

I now know how to handle arrays (as virtual structs, or tables), so I've started coding the LoreCheck functions, and arrays. I have moved some common/shared values into arrays (e.g. LevelStrings), and will continue to work on this. The idea is to tie it into tange-generated menus; and for Lore, make checks on items, locations, and other types of knowledge. For items, successful checks will set 'unlocked' conditions, and using the items will read the array, to find out what 'unlocked' state the item is at present, and operate on conditions based on that value

Example: A successful Lore check on a sword may give you historical details on it, and change its abilities such as lowing MP / HP costs, making its beams penetrating, increasing beam damage, increasing base damage, or adding/increasing scaling damage.

This system is not yet in place/working, as it entirely relies on Tango.

Selectable Arrow Ammunition, and Vows:

I added code for each arrow type, that defines their characteristics, making all three balanced:
  • Wooden: Damage x1, Speed x2
  • Steel: Damage x2, Sped x2
  • Enchanted: Damage x1.5, Speed x1.5
I will be adding a subscreen bar, to set current arrow type, from types available, to switch ammunition, and will be doing something similar with bows, to increase damage/speed; I may add range as a factor too.

At present, most of the code is there, and the arrows have their assigned values, but the selection process for these 9and other passive items) is unfinished.

Statistics:

At present, the Muscle stat is tied into swords, so that it is either added in full, or half its value is added, ad an attack modifier. As I make progress, every item will be tied to a statistic, and will operate on a modifier. Some items will increase stats when 'active'.

Passive items (Planned):

The player will need to enable their (desired) current passive items, with the following categories, and limits per type:
  • Hand-wear: Rings, and gauntlets. Max two total,combined from either type (two rings; or two gauntlets; or one ring & one gauntlet.
  • Armour: Select oje from your current inventory to equip at any time. I plan to have armour afford the player different forms of protection, and be balanced.
  • Head-gear: Circlets, and helms. The player cill be able to select one piece of head-gear. the planned items are the Circlet of Water, the Circlet of The Mind (increases CR_STAT_MIND), the Sernarani Coronet, and possibly special 'helms'.
  • Clothing: Affects number of pockets (used to store items), and may afford protection against heat & cold, but may be bulky (slowing movement). One set of clothing at a time; clothing and armour are two separate categories.
  • Foot-wear: One set of footwear at a time. Swimming will not use footwear, but rather, the Circlet of Water.
  • One Ladder/Bridge: Enable one ladder/bridge, or disable all types. (Prevents ladder/flippers game-engine indecision.)
  • Pendant/Talisman/Amulet: One at time. (There are no items of this type, at present.)
  • Eyewear: One set at a time. The EctoGoggles are the only item of this type at present.
Temporary Items:

Temporary items are now working, starting with the ;Cigar', that gives bonus HP (and MaxHP) while burning. used in gauntlets, as a way to boost HP. Clearing a room will drop one cigar per room, that keeps you going.

Currency System:
  • Money has sizes (volume of space used, not currency/monetary value.
  • Standard sizes are 1, 2, and 3. Small coins (any denominationP use 1-space-unit, CrySheets use 2-units, and large coins use 3-units.
  • Wallets increase carrying capacity.
  • Pockets increase carrying capacity.
  • Banks will change in your money for CryDiscs, sort of like an electronic payment chip, that takes 4-units, for whatever amount it contains. (They charge a commission for this.)
  • Planned: Secondary currency type, storing funds at banks.
  • Possibly Planned: I may change this to a float system, rather than an int system, so that smaller objects take up fractional space.
Title Screen:
The game has a title screen, but modifications to it have made part of the game title redundant. I;m dropping the prefix, so the overall working title for the story is now simple 'Legacy of Emperors'. A future update to the title screen will reflect this change.

Finally, I had hoped to mark the implementation of this with a full release, at r50, but r50 is alreay in SR Zed, SSR5, so the next release with all of this big stuff won't be a magically even milestone number like '50', but probably r51 to r54.

That should be all for the present. I plan that my next update will be a new, proper public release.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users