Difference between revisions of "User:Xudojnik"
(→WesMMO) |
|||
Line 136: | Line 136: | ||
usefulness[Player.inv.boots.item_id]=1; | usefulness[Player.inv.boots.item_id]=1; | ||
} | } | ||
− | Player.damage = ( TD[Player.class].strength + TD[Player.inv.body.item_id].strength + TD[Player.inv.boots.item_id].strength + Player.buffed.strength ) * | + | Player.damage = ( TD[Player.class].strength + TD[Player.inv.body.item_id].strength + TD[Player.inv.boots.item_id].strength + Player.buffed.strength ) * TD[Player.inv.melee.item_id].strength_multiplier * Player.buffed.strength_multiplier ; |
− | //Each class of items have it's own list of possible | + | //Each class of items have it's own list of possible stats. Thats why I call to each item, which can have such stats. |
} | } | ||
− | void TakeOffItem(itemid, itemtype, unit * Player) | + | void TakeOffItem(int itemid, string itemtype, unit * Player) |
{ | { | ||
CancelStats(itemid, itemtype, Player); | CancelStats(itemid, itemtype, Player); | ||
Line 147: | Line 147: | ||
} | } | ||
− | void PickUpItem(itemid, itemtype, unit * Player) | + | void PickUpItem(int itemid, string itemtype, unit * Player) |
{ | { | ||
CreateVariablesOfItem(new_item_id); | CreateVariablesOfItem(new_item_id); | ||
Give Stats(new_item_id); | Give Stats(new_item_id); | ||
usefulness[new_item_id]=1; | usefulness[new_item_id]=1; | ||
+ | } | ||
+ | |||
+ | void CancelStats(string itemtype, unit * Player) | ||
+ | { | ||
+ | switch(itemtype) | ||
+ | { | ||
+ | case "body" : | ||
+ | { | ||
+ | Player.inv.body.strength = 0; | ||
+ | Player.inv.body.stamina = 0; | ||
+ | Player.inv.body.strength = 0; | ||
+ | Player.inv.body.agility = 0; | ||
+ | Player.inv.body.pierce = 0; | ||
+ | Player.inv.body.blade = 0; | ||
+ | Player.inv.body.blow = 0; | ||
+ | Player.inv.body.arcane = 0; | ||
+ | Player.inv.body.fire = 0; | ||
+ | Player.inv.body.cold = 0; | ||
+ | Player.inv.body.item_id = 0; | ||
+ | } break; | ||
+ | |||
+ | case "boots" : | ||
+ | { | ||
+ | Player.inv.boots.speed_multiplier = 0; | ||
+ | Player.inv.boots.stamina = 0; | ||
+ | Player.inv.boots.strength = 0; | ||
+ | Player.inv.boots.agility = 0; | ||
+ | Player.inv.boots.item_id = 0; | ||
+ | } break; | ||
+ | |||
+ | case "head" : | ||
+ | { | ||
+ | Player.inv.head.pierce = 0; | ||
+ | Player.inv.head.blade = 0; | ||
+ | Player.inv.head.blow = 0; | ||
+ | Player.inv.head.item_id = 0; | ||
+ | } break; | ||
+ | |||
+ | case "melee" : | ||
+ | { | ||
+ | Player.inv.melee.strength_multiplier = 0; | ||
+ | Player.inv.melee.speed = 0; | ||
+ | Player.inv.melee.defense = 0; | ||
+ | Player.inv.melee.item_id = 0; | ||
+ | } break; | ||
+ | |||
+ | case "ranged" : | ||
+ | { | ||
+ | Player.inv.ranged.agility_multiplier = 0; | ||
+ | Player.inv.ranged.speed = 0; | ||
+ | Player.inv.ranged.defense = 0; | ||
+ | Player.inv.ranged.item_id = 0; | ||
+ | } break; | ||
+ | |||
+ | default : | ||
+ | { | ||
+ | ErrorMessage(); | ||
+ | } | ||
+ | } | ||
} | } |
Revision as of 18:58, 2 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.
There are function, what are completed or close to it:
- Weapon vendor.
- Potion vendor.
- Home(place, where hero can change his weapons, take rest).
- Stable, where hero can buy horse.
- Mounting/dismounting on that horse. Two types of weapon: for mounted hero and foot.
- Talking to NPC's.
- NPC's shedule in one string.
- Spellcasting system (general-purpose examples of spells, what can be copied and changed later).
- Quest log now wait for content.
- Beneficial spell effects needs only more spells.
- Improved inventory, Spellbook.
There are in the future:
- Dog (taming, training, feeding).
- Levelling and customising character.
At the end of my work, I get unimaginable amount of lags, long and boring loading time and HUGE savegames. And I leave it. Now I wait for stable version of BfW 1.9. The only reason is implemented persistent variables. I will wrote here some basic terms of this project.
WesMMO
To play it (now only in theory):
- 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.
- Get fun.
- Download some other playable map, designed for WesMMO.
- Create game in lobby.
- Map will automatically use your account. Now choose any existed character and play.
- I planned to invent spell-system in this MMO, but not yet decide about mana and cooldowns.
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 2 (3?) 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 of 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 potency of unit.
Each item has it own's id. Data about it will be stored inside WesMMO era. That allows me to implement 'inventory slots'. Players will carry unused items in them.
Spellbook will contains information about direct spells and units's auras.
- 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.
- List of variables
- stat.stamina.base + it will contain base stats, what will only depends from the class of unit
- stat.stamina.buffed
- stat.stamina.total_modifier need this to implement debuffs like -50% hp, default "1"
- stat.strength.base +
- stat.strength.buffed
- stat.strength.total_modifier
- stat.speed.base +
- stat.speed.buffed
- stat.speed.total_modifier
- stat.agility.base +
- stat.agility.buffed
- stat.agility.total_modifier
- stat.damage_multiplier
- inv.healing +
- inv.melee.item_id +
- inv.melee.strength_multiplier +
- inv.melee.agility_multiplier + possible implement this as "class bonus" or "weapon type"
- inv.melee.speed + there are no proc system. thats why speed multiplier will be unused
- inv.melee.defense
- inv.ranged.agility_multiplier +
- inv.ranged.strength_multiplier + who knows, who knows...
- inv.ranged.speed +
- inv.body.stamina +
- inv.body.strength +
- inv.body.agility +
- inv.body.pierce +
- inv.body.blade +
- inv.body.blow +
- inv.body.arcane +
- inv.body.fire +
- inv.body.cold +
- inv.boots.speed_multiplier +
- inv.boots.stamina +
- inv.boots.strength +
- inv.boots.agility +
- inv.head.pierce +
- inv.head.blade +
- inv.head.blow +
- spb.aura_id +
- spb.aura_id +
- spb.aura_id +
- spb.direct_id +
- spb.direct_id +
- spb.direct_id +
In perfect way, I should create some sort of database (TD).
1) It consist of tree parts. First parts should contain booleans to check "does item useful?". And second should contain one big macro, what will create variables for "useful items". There will be as much of this DB's as slots for items.
void UpdateDatabase() { for( int i = 0; i < NUMBER_OF_ITEMS; i ++ ) { if( usefulness[i] ) CreateVariablesOfItem( i ); if( !usefulness[i] ) ClearVariablesOfItem( i ); } }
unit Player; StoreUnit( Player ); void UpdateStats( unit * Player ) { if( !usefulness[Player.inv.body.item_id] ) { CreateVariablesOfItem( Player.inv.body.item_id ); usefulness[Player.inv.body.item_id]=1; } if( !usefulness[Player.inv.boots.item_id] ) { CreateVariablesOfItem( Player.inv.boots.item_id ); usefulness[Player.inv.boots.item_id]=1; } Player.damage = ( TD[Player.class].strength + TD[Player.inv.body.item_id].strength + TD[Player.inv.boots.item_id].strength + Player.buffed.strength ) * TD[Player.inv.melee.item_id].strength_multiplier * Player.buffed.strength_multiplier ; //Each class of items have it's own list of possible stats. Thats why I call to each item, which can have such stats. }
void TakeOffItem(int itemid, string itemtype, unit * Player) { CancelStats(itemid, itemtype, Player); ClearVariablesOfItem(itemid); usefulness[itemid]=0; }
void PickUpItem(int itemid, string itemtype, unit * Player) { CreateVariablesOfItem(new_item_id); Give Stats(new_item_id); usefulness[new_item_id]=1; }
void CancelStats(string itemtype, unit * Player) { switch(itemtype) { case "body" : { Player.inv.body.strength = 0; Player.inv.body.stamina = 0; Player.inv.body.strength = 0; Player.inv.body.agility = 0; Player.inv.body.pierce = 0; Player.inv.body.blade = 0; Player.inv.body.blow = 0; Player.inv.body.arcane = 0; Player.inv.body.fire = 0; Player.inv.body.cold = 0; Player.inv.body.item_id = 0; } break; case "boots" : { Player.inv.boots.speed_multiplier = 0; Player.inv.boots.stamina = 0; Player.inv.boots.strength = 0; Player.inv.boots.agility = 0; Player.inv.boots.item_id = 0; } break; case "head" : { Player.inv.head.pierce = 0; Player.inv.head.blade = 0; Player.inv.head.blow = 0; Player.inv.head.item_id = 0; } break; case "melee" : { Player.inv.melee.strength_multiplier = 0; Player.inv.melee.speed = 0; Player.inv.melee.defense = 0; Player.inv.melee.item_id = 0; } break; case "ranged" : { Player.inv.ranged.agility_multiplier = 0; Player.inv.ranged.speed = 0; Player.inv.ranged.defense = 0; Player.inv.ranged.item_id = 0; } break; default : { ErrorMessage(); } } }