Difference between revisions of "User:Xudojnik"

From The Battle for Wesnoth Wiki
Line 122: Line 122:
 
{| border="1"
 
{| border="1"
 
|rowspan="8"|inv
 
|rowspan="8"|inv
  |body_item_id<br>boots_item_id<br>head_item_id<br>amulet_item_id<br>melee_item_id<br>ranged_item_id<br>healing_potions<br>body_user_name<br>boots_user_name<br>head_user_name<br>amulet_user_name<br>melee_user_name<br>ranged_user_name
+
  |body_item_id<br>boots_item_id<br>head_item_id<br>amulet_item_id<br>melee_item_id<br>ranged_item_id<br>''healing_potions''<br>body_user_name<br>boots_user_name<br>head_user_name<br>amulet_user_name<br>melee_user_name<br>ranged_user_name
 
   |
 
   |
 
  |-
 
  |-

Revision as of 12:29, 14 September 2010

I know Wesnoth from version 1.1.2a. This is really perspective game not only as strategy, but as RPG too. Large world, filled by history, epic battles, heroes and factions, is perfect for creating RPG. It's not so hard because Wesnoth have simple language, what support wide variety of events, easy way to define dialogs, items, forum and Wiki, where always can be found answer for any question.

WesMMO

To play it (now only in theory):

  1. Design new character.
    • Download WesMMO era.
    • Download beginner's map, designed for WesMMO.
    • Create game in lobby.
    • Create an "account" and character on it.
    • Win beginner's scenario.
  2. Get fun.
    • Download some other playable map, designed for WesMMO.
    • Create game in lobby.
    • Map will automatically use your account. Now choose any three units from your account and play.
Spell system
Each class have some predefined spells. In most cases they are not simple "damage unit X for Y hp". That's why they are the greatest headache for me.
Each unit can use it's spell once per turn.
There are no limit of uses through whole scenario.

Character is a "team" of three units. Each unit have own stats, small inventory and spellbook.

Stats should be simple
Stamina - increases your hitpoints by 5 per point.
Strength - increases your melee damage.
Speed - increases your movement points.
Agility - increase your defense on each type of terrain by 1% per point and ranged damage.
Intellect or Spell Power (or both)- increase magical potence of unit
Inventory contains
Healing Potion - number of them.
Mana Potions - number of them.
Melee Weapon - affects melee combat: strength_multiplier and number_of_strikes and possibly defenses.
Ranged Weapon - affects ranged combat: damage_from_agility_multiplier and number_of_strikes.
Amulet - affects base stats, magical resistances and magical potency of unit
Body Armor - affects base stats, all resistances and defenses.
Boots - affects base stats and have movement_multipier.
Helm - affects melee resistances and magical potence of unit.

Each item has it own's id. This ID is the key to macro what will apply effect of item stats to unit structure. Data about it will be stored inside WesMMO era. That allows me to implement 'inventory slots'. Players will carry unused items in them.

Classes of units
Class Name Description Type
Stalwart
tank
Whirlwind Damages all nearby enemies. Spell
Stun Temporary stun nearby enemy. Spell
Circle defense Increase resistances of nearby allies by 50% of caster's resistance. Cancels when caster moves. Aura
Last Stand Increase caster's agility for amount of nearby allies agility. Cancels when caster moves. Self-aura
Berserker
melee damage-dealer
Reklesness Temporary increase damage by 25% and decrease all resistances by 1/2. Spell
Inspire Increase damage of all nearby allies by 25% and decrease own damage by 50%. Cancels when caster moves. Aura
Berserker's strike Damage nearby enemy for 2x of weapon damage. Spell
Cleave attack Damage three nearby enemies for weapon damage.(targeted and two nearby to it and caster) Spell
Poacher
ranged damage-dealer
Piercing shot Damage enemy and unit behind it. Spell
Way Guidance Temporary gives to nearby allied units an ability to ignore ZoC and terrain cost. Spell
Throw net Decrease movement costs of three nearby enemies.(targeted and two nearby to it and caster) Spell
Camouflage Hides nearby allied units if they are on the same terrain as a caster. Cancels when caster moves. Aura
Cleric
healer, spell damage-dealer
Medicine Heal full and cure nearby allied unit. Spell
Lightbeam Channels the pure beam of light to burn caster's enemy. Spell
Inner light Gives nearby units an ability to ignore ToD. Cancels when caster moves. Aura
Anti-magic Shield Increases resistances of all nearby allies by 50% of caster's resistances. Cancel when caster moves. Aura
How does this work

There should be macro to refresh visible stats of hero (hp, damage e.t.c.) It should be called when unit change it's base stats.

Database is a ton of functions what changes values of equipped items in "unit[<number of selected units to play with>].inv". Virtual data about units will be stored in structure "character[<number of sides>].unit[]..."

Content of "unit" structure.

inv body_item_id
boots_item_id
head_item_id
amulet_item_id
melee_item_id
ranged_item_id
healing_potions
body_user_name
boots_user_name
head_user_name
amulet_user_name
melee_user_name
ranged_user_name
body stamina
strength
agility
pierce
blade
blow
arcane
fire
cold
boots stamina
strength
agility
speed
speed_multiplier
head pierce
blade
blow
intellect
amulet intellect
arcane
fire
cold
stamina
melee strength_multiplier
type
speed
defense
ranged agility_multiplier
type
speed
free_slot[6] item_id
item_type
item_user_name
item_stat[9] It's no matter what is in this item. WesMMO decode it when need it.
class stamina
strength
speed
agility
defense castle
cave
deep_water
flat
forest
frozen
fungus
hills
reef
sand
shallow_water
swamp_water
resistance arcane
blade
cold
fire
impact
pierce
buffed strength
agility
speed
pierce
blade
blow
arcane
fire
cold
hitpoints_multiplier
strength_multiplier
agility_multiplier
speed_multiplier
max_experience
int max_hitpoints
int max_moves
defense castle
cave
deep_water
flat
forest
frozen
fungus
hills
reef
sand
shallow_water
swamp_water
resistance arcane
blade
cold
fire
impact
pierce
attack[2] damage
number
type
range

struct "inv" will be stored as persistent variable. Other structures will be forgotten, because there will be functions to calculate their content.

unit Player;
StoreUnit( Player );
//This function counts output values, what player will see on the right panel.

void UpdateStats( unit * Player )
{ 
 Player.damage = 

 Temp = Player.max_hitpoints / Player.hitpoints;

 Player.max_hitpoints = ( Player.class.stamina + Player.inv.body.stamina + Player.inv.boots.stamina + Player.buffed.stamina ) * Player.buffed.hitpoints_multiplier;

 Player.hitpoints = Player.max_hitpoints / Temp;

 Player.max_moves = ( Player.class.speed + Player.inv.boots.speed + Player.buffed.speed ) * Player.inv.boots.speed_multiplier * Player.buffed.speed_multiplier;

 Player.defense.castle = Player.class.defense.castle + Player.buffed.defense.castle + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5; // I can easily tweak it later.

 Player.defense.cave = Player.class.defense.cave + Player.buffed.defense.cave + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5; // I can easily tweak it later.

 Player.defense.deep_water = Player.class.defense.deep_water + Player.buffed.defense.deep_water + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5;

 Player.defense.flat = Player.class.defense.flat + Player.buffed.defense.flat + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5;

 Player.defense.forest = Player.class.defense.forest + Player.buffed.defense.forest + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5;

 Player.defense.frozen = Player.class.defense.frozen + Player.buffed.defense.frozen + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5;

 Player.defense.fungus = Player.class.defense.fungus + Player.buffed.defense.fungus + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5;

 Player.defense.hills = Player.class.defense.hills + Player.buffed.defense.hills + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5;

 Player.defense.reef = Player.class.defense.reef + Player.buffed.defense.reef + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5;

 Player.defense.sand = Player.class.defense.sand + Player.buffed.defense.sand + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5;

 Player.defense.shallow_water = Player.class.defense.shallow_water + Player.buffed.defense.shallow_water + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5;

 Player.defense.swamp_water = Player.class.defense.swamp_water + Player.buffed.defense.swamp_water + Player.inv.melee.defense + ( Player.class.agility + Player.buffed.agility + Player.inv.body.agility + Player.inv.boots.agility ) * 5;

 Player.resistance.arcane = Player.class.resistance.arcane + Player.buffed.resistance.arcane + Player.body.arcane;

 Player.resistance.fire = Player.class.resistance.fire + Player.buffed.resistance.fire + Player.body.fire;

 Player.resistance.cold = Player.class.resistance.cold + Player.buffed.resistance.cold + Player.body.cold;

 Player.resistance.pierce = Player.class.resistance.pierce + Player.buffed.resistance.pierce + Player.body.pierce + Player.head.pierce;

 Player.resistance.blow = Player.class.resistance.blow + Player.buffed.resistance.blow + Player.body.blow + Player.head.blow;

 Player.resistance.blade = Player.class.resistance.blade + Player.buffed.resistance.blade + Player.body.blade + Player.head.blade;

 Player.attack[0].damage = ( Player.class.strength + Player.inv.body.strength + Player.inv.boots.strength + Player.buffed.strength ) *  Player.inv.melee.strength_multiplier * Player.buffed.damage_multiplier;

 Player.attack[0].number = Player.inv.melee.speed;

 Player.attack[0].type = Player.inv.melee.type;

 Player.attack[1].damage = ( Player.class.agility + Player.inv.body.agility + Player.inv.boots.agility + Player.buffed.agility ) *  Player.inv.melee.agility_multiplier * Player.buffed.damage_multiplier;

 Player.attack[1].number = Player.inv.ranged.speed;

 Player.attack[1].type = Player.inv.ranged.type;
}
UnstoreUnit();
void TakeOffItem( int itemid, string itemtype, unit * Player )
{
}
void PickUpItem( int itemid, string itemtype, unit * Player )
{
}

TODO:
ADD BASE_DAMAGE TO WEAPONS


Add missed formulas to UpdateStats();.
Update PickUpItem();.
Update TakeOffItem();.
Implement free slots.
Make things clear about spells.
Make things clear about AMLA.
Make things clear about trade.
Implement loot tables from bosses and mobs.
Implement "Group Loot".