Character

Submitted by Brutus5000 on Wed, 07/20/2016 - 01:04
Semantic
  • Every GW player has one character at a time, which he uses to take action in the universe.
  • The character belongs to one of the factions.
  • The character can level up. See ranks.
  • The character can die in battle. If this is the case, the GW player can no longer use this character. The GW player will get assigned a new character instead. The dead character will remain in the hall of fame of his faction.
Table name
characters
Table structure
  • id [INT, PRIMARY KEY, AUTO_INCREMENT]
  • faf_id [INT]: the reference to the faf user account for this character
  • name [VARCHAR/20]: the name of the character
  • faction [CHAR]: the faction of the player -  [U]ef, [A]eon, [C]ybran, [S]eraphim
  • Killed by [INT, NULLABLE]: character-id who killed this characted
Calculated Fields
  • Credits: SELECT SUM(amount) FROM credit_journal WHERE credit_journal.fk_character = characters.id
  • XP: SELECT SUM(amount) FROM battle_xp WHERE fk_character = characters.id
  • Free for battle: SELECT (SELECT COUNT(battles.id) FROM battles JOIN battle_participant ON battle_participant.fk_battle = battles.id WHERE battle.status IN ('I','R') AND battle_participant.fk_character = characters.id) = 0
  • Rank: SELECT new_rank FROM promotions WHERE fk_character = characters.id ORDER BY created_ad DESC LIMIT 1
  • Total Recalls: SELECT COUNT(result) FROM battle_participants WHERE fk_character = characters.id AND result = 'R'
  • Total Victories: SELECT COUNT(result) FROM battle_participants WHERE fk_character = characters. id AND result = 'V'
  • Successfull Attacks: SELECT COUNT(result) FROM battle_participants WHERE fk_character = characters.id AND result = 'V' AND role = 'A'
  • Successfull Defences: SELECT COUNT(result) FROM battle_participants WHERE fk_character = characters.id AND result = 'V' AND role = 'D'
  • Killed at (battle-id): SELECT fk_battle FROM battle_participants WHERE fk_character = characters.id AND result = 'D'

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.