Browse Source

Badge tweaks

master
Skylar Ittner 5 months ago
parent
commit
78a46edd37
3 changed files with 23 additions and 2 deletions
  1. BIN
      database.mwb
  2. 22
    1
      database/migrate_v1.sql
  3. 1
    1
      lib/Player.lib.php

BIN
database.mwb View File


+ 22
- 1
database/migrate_v1.sql View File

@@ -165,4 +165,25 @@ CREATE TABLE IF NOT EXISTS `terranquest`.`player_stats` (
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_bin;
COLLATE = utf8_bin;

ALTER TABLE `terranquest`.`badges`
DROP COLUMN `badgesid`,
CHANGE COLUMN `badgename` `name` VARCHAR(50) CHARACTER SET 'utf8' NOT NULL ,
CHANGE COLUMN `badgedesc` `desc` VARCHAR(400) CHARACTER SET 'utf8' NOT NULL ,
ADD COLUMN `icon` VARCHAR(100) NOT NULL AFTER `desc`,
ADD COLUMN `color` VARCHAR(45) NOT NULL DEFAULT 'white' AFTER `icon`,
ADD COLUMN `background` VARCHAR(255) NULL DEFAULT '#008000' AFTER `color`;

INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (1,'Beta Tester','Took part in the version 1 beta.','game-icon game-icon-ladybug','black','#5bca6c');
INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (2,'Developer','Contributed to TerranQuest code.','game-icon game-icon-computing','#32d74a','black');
INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (3,'Administrator','A TerranQuest administrator.','game-icon game-icon-processor','#00ff3b','black');
INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (4,'Moderator','Wielder of the banhammer.','game-icon game-icon-thor-hammer','red','white');
INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (5,'Alpha Tester','Helped during the version 1 alpha.','game-icon game-icon-spotted-bug','black','#ff5c31');
INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (6,'Migrator','Played TerranQuest version 1.','game-icon game-icon-upgrade','black','#00c853');
INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (7,'Attacker','Attacked places 1,000 times.','game-icon game-icon-targeting','red','black');
INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (8,'Assassin','Attacked places 10,000 times.','game-icon game-icon-multiple-targets','red','black');
INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (9,'Defender','Defended places 1,000 times.','game-icon game-icon-shield','green','black');
INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (10,'Guard','Defended places 10,000 times.','game-icon game-icon-shield-reflect','green','black');
INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (11,'Finder','Scanned 250 codes.','game-icon game-icon-target-laser','white','black');
INSERT INTO `badges` (`badgeid`,`name`,`desc`,`icon`,`color`,`background`) VALUES (12,'Hoarder','Scanned 1,000 codes.','game-icon game-icon-open-treasure-chest','#ff6f00','white');

+ 1
- 1
lib/Player.lib.php View File

@@ -41,7 +41,7 @@ class Player {
$this->stealth = $profile["stealth"] == true;
$this->exists = true;

$this->badges = $database->select("player_badges", ["[>]badges" => "badgeid"], ["id", "name", "desc", "icon", "color", "background", "gotdate (date)"], ["accountid" => $user->getUID()]);
$this->badges = $database->select("player_badges", ["[>]badges" => "badgeid"], ["name", "desc", "icon", "color", "background", "gotdate (date)"], ["accountid" => $user->getUID()]);
} else {
$this->exists = false;
}

Loading…
Cancel
Save