mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-08 14:30:18 +00:00
Prepare for inventory command processing
This commit is contained in:
parent
e1c2c9c4d5
commit
afd05c4bec
@ -24,23 +24,21 @@ word global
|
|||||||
|
|
||||||
// Exported functions go here. First a predef for each one, then a table with function pointers
|
// Exported functions go here. First a predef for each one, then a table with function pointers
|
||||||
// in the same order as the constants are defined in the the header.
|
// in the same order as the constants are defined in the the header.
|
||||||
predef _party_showPlayerSheet
|
predef _party_doPlayerSheet
|
||||||
word[] funcTbl = @_party_showPlayerSheet
|
word[] funcTbl = @_party_doPlayerSheet
|
||||||
|
|
||||||
// Other global variables here
|
// Other global variables here
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Show player data
|
// Show player data
|
||||||
def _party_showPlayerSheet(num)
|
def showPlayerSheet(num)
|
||||||
word player, item
|
word player, item
|
||||||
|
|
||||||
// Count the number of players
|
// Count the number of players
|
||||||
player = global=>p_players
|
player = global=>p_players
|
||||||
while num > 0
|
while num > 0
|
||||||
player = player=>p_nextObj
|
player = player=>p_nextObj
|
||||||
if !player // Not that many players
|
if !player; return; fin // Not that many players
|
||||||
return
|
|
||||||
fin
|
|
||||||
num--
|
num--
|
||||||
loop
|
loop
|
||||||
|
|
||||||
@ -50,11 +48,11 @@ def _party_showPlayerSheet(num)
|
|||||||
// Next, show inventory in the main panel
|
// Next, show inventory in the main panel
|
||||||
setMapWindow()
|
setMapWindow()
|
||||||
clearWindow()
|
clearWindow()
|
||||||
rawDisplayStr("^Y^LInventory^L^N\n")
|
rawDisplayStr("^Y^LInventory^L^N")
|
||||||
item = player=>p_items
|
item = player=>p_items
|
||||||
while item
|
while item
|
||||||
displayStr(item=>s_name)
|
|
||||||
displayStr("\n")
|
displayStr("\n")
|
||||||
|
displayStr(item=>s_name)
|
||||||
item = item=>p_nextObj
|
item = item=>p_nextObj
|
||||||
loop
|
loop
|
||||||
|
|
||||||
@ -62,27 +60,44 @@ def _party_showPlayerSheet(num)
|
|||||||
setWindow2()
|
setWindow2()
|
||||||
clearWindow()
|
clearWindow()
|
||||||
rawDisplayStr("^Y^LStats^L^N\n")
|
rawDisplayStr("^Y^LStats^L^N\n")
|
||||||
displayf1("%d", player=>w_health); rawDisplayStr("^T024Health\n")
|
displayf1("%d", player=>w_health); rawDisplayStr("^T024Health\n")
|
||||||
displayf1("%d", player->b_intelligence); rawDisplayStr("^T024Intelligence\n")
|
displayf1("%d", player->b_intelligence); rawDisplayStr("^T024Intelligence\n")
|
||||||
displayf1("%d", player->b_strength); rawDisplayStr("^T024Strength\n")
|
displayf1("%d", player->b_strength); rawDisplayStr("^T024Strength\n")
|
||||||
displayf1("%d", player->b_agility); rawDisplayStr("^T024Agility\n")
|
displayf1("%d", player->b_agility); rawDisplayStr("^T024Agility\n")
|
||||||
displayf1("%d", player->b_stamina); rawDisplayStr("^T024Stamina\n")
|
displayf1("%d", player->b_stamina); rawDisplayStr("^T024Stamina\n")
|
||||||
displayf1("%d", player->b_charisma); rawDisplayStr("^T024Charisma\n")
|
displayf1("%d", player->b_charisma); rawDisplayStr("^T024Charisma\n")
|
||||||
displayf1("%d", player->b_spirit); rawDisplayStr("^T024Spirit\n")
|
displayf1("%d", player->b_spirit); rawDisplayStr("^T024Spirit\n")
|
||||||
displayf1("%d", player->b_luck); rawDisplayStr("^T024Luck\n")
|
displayf1("%d", player->b_luck); rawDisplayStr("^T024Luck\n")
|
||||||
displayf1("%d", player->b_armor); rawDisplayStr("^T024Armor\n")
|
displayf1("%d", player->b_armor); rawDisplayStr("^T024Armor\n")
|
||||||
|
|
||||||
// Show aquired skills in lower right panel
|
// Show aquired skills in lower right panel
|
||||||
setWindow3()
|
setWindow3()
|
||||||
clearWindow()
|
clearWindow()
|
||||||
rawDisplayStr("^Y^LSkills^L^N")
|
rawDisplayStr("^Y^LSkills^L^N")
|
||||||
if player->b_aiming; displayStr("\nAiming"); fin
|
if player->b_aiming; displayStr("\nAiming"); fin
|
||||||
if player->b_handToHand; displayStr("\nHand-to-Hand"); fin
|
if player->b_handToHand; displayStr("\nHand-to-Hand"); fin
|
||||||
if player->b_dodging; displayStr("\nDodging"); fin
|
if player->b_dodging; displayStr("\nDodging"); fin
|
||||||
|
return player
|
||||||
|
end
|
||||||
|
|
||||||
// Get a key, do something
|
// Show player sheet and accept command
|
||||||
getUpperKey()
|
def _party_doPlayerSheet(num)
|
||||||
// do something here
|
word player
|
||||||
|
|
||||||
|
repeat
|
||||||
|
player = showPlayerSheet(num)
|
||||||
|
if !player; return; fin // Invalid player
|
||||||
|
// Get a key, do something
|
||||||
|
when getUpperKey()
|
||||||
|
// Select another player to show
|
||||||
|
is '1'; num = 0; break
|
||||||
|
is '2'; num = 1; break
|
||||||
|
is '3'; num = 2; break
|
||||||
|
// Other operations...
|
||||||
|
// All done
|
||||||
|
otherwise return
|
||||||
|
wend
|
||||||
|
until 0
|
||||||
end
|
end
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user