Skip to content

Commit

Permalink
Renamed Stats and Attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
darozak committed May 26, 2024
1 parent 0cefca6 commit b672ede
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
6 changes: 3 additions & 3 deletions Code/dist/hardware.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Item {
this.effects = effects;
}
}
class Stats {
class Attributes {
credits = 0;
HPs = 0;
maxHPs = 0;
Expand Down Expand Up @@ -82,8 +82,8 @@ class Stats {
}
}
class Robot {
baseStats = new Stats();
adjustedStats = new Stats();
baseStats = new Attributes();
adjustedStats = new Attributes();
items = [];
constructor() {
this.baseStats.maxCarry = 4;
Expand Down
4 changes: 2 additions & 2 deletions Code/dist/robot_data.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
class RobotData {
baseStats = new Stats();
adjustedStats = new Stats();
baseStats = new Attributes();
adjustedStats = new Attributes();
items = [];
lastScan = 0;
robotID;
Expand Down
10 changes: 5 additions & 5 deletions Code/dist/world_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ class GaiaData extends WorldData {
this.tiles.push(new Tile("Door", "+", new Vector(12, 3), false, 0.0));
// Create Items
var effects;
effects = new Stats();
effects = new Attributes();
effects.scanCost = 0;
effects.scanRange = 4;
effects.scanTime = 8;
this.items.push(new Item('Scanner', effects));
effects = new Stats();
effects = new Attributes();
effects.thermalDamage = 4;
this.items.push(new Item('Blaster', effects));
effects = new Stats();
effects = new Attributes();
effects.thermalDefense = 1;
this.items.push(new Item('Shield', effects));
effects = new Stats();
effects = new Attributes();
effects.HPs = 60;
effects.maxHPs = 60;
this.items.push(new Item('Armor', effects));
effects = new Stats();
effects = new Attributes();
effects.power = 2000;
effects.maxPower = 2000;
this.items.push(new Item('Battery', effects));
Expand Down
14 changes: 7 additions & 7 deletions Code/src/hardware.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

class Item {
name: string;
effects: Stats;
effects: Attributes;
timeToEquip: number = 10;
isEquipped: boolean = false;

constructor(name: string, effects: Stats) {
constructor(name: string, effects: Attributes) {
this.name = name;
this.effects = effects;
}
}

class Stats {
class Attributes {
credits = 0;
HPs = 0;
maxHPs = 0;
Expand Down Expand Up @@ -42,7 +42,7 @@ class Stats {

constructor() {}

add(stats: Stats) {
add(stats: Attributes) {
this.credits += stats.credits;
this.HPs += stats.HPs;
this.maxHPs += stats.maxHPs;
Expand Down Expand Up @@ -75,7 +75,7 @@ class Stats {
this.backgroundPower += stats.backgroundPower;
}

copy(stats: Stats) {
copy(stats: Attributes) {
this.credits = stats.credits;

this.maxHPs = stats.maxHPs;
Expand Down Expand Up @@ -108,8 +108,8 @@ class Stats {
}

class Robot {
baseStats = new Stats();
adjustedStats = new Stats();
baseStats = new Attributes();
adjustedStats = new Attributes();
items: Item[] = [];

constructor() {
Expand Down
4 changes: 2 additions & 2 deletions Code/src/robot_data.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

class RobotData {

baseStats = new Stats();
adjustedStats = new Stats();
baseStats = new Attributes();
adjustedStats = new Attributes();

items: Item[] = [];

Expand Down
12 changes: 6 additions & 6 deletions Code/src/world_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ class GaiaData extends WorldData {
this.tiles.push(new Tile("Door", "+", new Vector(12,3), false, 0.0));

// Create Items
var effects: Stats;
var effects: Attributes;

effects = new Stats();
effects = new Attributes();
effects.scanCost = 0;
effects.scanRange = 4;
effects.scanTime = 8;
this.items.push(new Item('Scanner', effects));

effects = new Stats();
effects = new Attributes();
effects.thermalDamage = 4;
this.items.push(new Item('Blaster', effects));

effects = new Stats();
effects = new Attributes();
effects.thermalDefense = 1;
this.items.push(new Item('Shield', effects));

effects = new Stats();
effects = new Attributes();
effects.HPs = 60;
effects.maxHPs = 60;
this.items.push(new Item('Armor', effects));

effects = new Stats();
effects = new Attributes();
effects.power = 2000;
effects.maxPower = 2000;
this.items.push(new Item('Battery', effects));
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ The item class is used to describe to properties and status of all in-game items
| name | string | The name of the item. |
| timeToEquip | number | This is the time required to equip an item for use. |

## Attributes Class

## Action Classes
Advolition has eight pre-defined Action class extensions that the robot can use to describe it's next move. These classes are as follows:

Expand Down

0 comments on commit b672ede

Please sign in to comment.