Skip to content

Commit

Permalink
feat: init data models; move calculation in models
Browse files Browse the repository at this point in the history
  • Loading branch information
rudnovd committed Dec 3, 2020
1 parent 1e789c6 commit 0789647
Show file tree
Hide file tree
Showing 10 changed files with 902 additions and 0 deletions.
537 changes: 537 additions & 0 deletions src/models/Calculator.ts

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/models/Class.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export interface Class {
id: number
name: string
attack: number
defense: number
power: number
knowledge: number
}

export interface ClassTranslation {
id: number
name: string
}
27 changes: 27 additions & 0 deletions src/models/Creature.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export interface Creature {
aiValue?: number
attack: number
cost?: number
defense: number
fightValue?: number
growth?: number
health: number
hits: number
id: number
level: number
maxDamage: number
minDamage: number
nativeTerrain: number
speed?: number
name: string
ranged?: boolean
townId?: number
hexs?: number
shots?: number
hates?: Array<number>
}

export interface CreatureTranslation {
id: number
name: string
}
13 changes: 13 additions & 0 deletions src/models/Hero.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export interface Hero {
id: number
name: string
classId: number
specialtySkill?: string
specialtySpell?: number
specialtyUnit?: Array<number>
}

export interface HeroTranslation {
id: number
name: string
}
10 changes: 10 additions & 0 deletions src/models/Level.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface Level {
id: number
name: string
value: number
}

export interface LevelTranslation {
id: number
name: string
}
9 changes: 9 additions & 0 deletions src/models/Skill.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface Skill {
id: number
name: string
}

export interface SkillTranslation {
id: number
name: string
}
15 changes: 15 additions & 0 deletions src/models/Spell.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export interface Spell {
id: number
name: string
level: number
element: Elements
}

export interface SpellTranslation {
id: number
name: string
element: ElementsRu
}

type Elements = 'Neutral' | 'Fire' | 'Water' | 'Earth' | 'Air'
type ElementsRu = 'Нейтральный' | 'Огонь' | 'Вода' | 'Земля' | 'Воздух'
9 changes: 9 additions & 0 deletions src/models/Terrain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface Terrain {
id: number
name: string
}

export interface TerrainTranslation {
id: number
name: string
}
9 changes: 9 additions & 0 deletions src/models/Town.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface Town {
id: number
name: string
}

export interface TownTranslation {
id: number
name: string
}
260 changes: 260 additions & 0 deletions src/models/enums.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
export enum Creatures {
Pikeman = 1,
Halberdier,
Archer,
Marksman,
Griffin,
RoyalGriffin,
Swordsman,
Crusader,
Monk,
Zealot,
Cavalier,
Champion,
Angel,
Archangel,
Centaur,
CentaurCaptain,
Dwarf,
BattleDwarf,
WoodElf,
GrandElf,
Pegasus,
SilverPegasus,
DendroidGuard,
DendroidSoldier,
Unicorn,
WarUnicorn,
GreenDragon,
GoldDragon,
Gremlin,
MasterGremlin,
StoneGargoyle,
ObsidianGargoyle,
StoneGolem,
IronGolem,
Mage,
ArchMage,
Genie,
MasterGenie,
Naga,
NagaQueen,
Giant,
Titan,
Skeleton,
SkeletonWarrior,
WalkingDead,
Zombie,
Wight,
Wraith,
Vampire,
VampireLord,
Lich,
PowerLich,
BlackKnight,
DreadKnight,
BoneDragon,
GhostDragon,
Troglodyte,
InfernalTroglodyte,
Harpy,
HarpyHag,
Beholder,
EvilEye,
Medusa,
MedusaQueen,
Minotaur,
MinotaurKing,
Manticore,
Scorpicore,
RedDragon,
BlackDragon,
Imp,
Familiar,
Gog,
Magog,
HellHound,
Cerberus,
Demon,
HornedDemon,
PitFiend,
PitLord,
Efreet,
EfreetSultan,
Devil,
ArchDevil,
Gnoll,
GnollMarauder,
Lizardman,
LizardWarrior,
SerpentFly,
DragonFly,
Basilisk,
GreaterBasilisk,
Gorgon,
MightyGorgon,
Wyvern,
WyvernMonarch,
Hydra,
ChaosHydra,
Goblin,
Hobgoblin,
WolfRider,
WolfRaider,
Orc,
OrcChieftain,
Ogre,
OgreMage,
Roc,
Thunderbird,
Cyclops,
CyclopsKing,
Behemoth,
AncientBehemoth,
Pixie,
Sprite,
AirElemental,
StormElemental,
WaterElemental,
IceElemental,
FireElemental,
EnergyElemental,
EarthElemental,
MagmaElemental,
PsychicElemental,
MagicElemental,
Firebird,
Phoenix,
Peasant,
Halfling,
Boar,
Rogue,
Nomad,
Mummy,
Sharpshooter,
Troll,
GoldGolem,
DiamondGolem,
Enchanter,
FaerieDragon,
RustDragon,
CrystalDragon,
AzureDragon,
Nymph,
Oceanid,
CrewMate,
Seaman,
Pirate,
Corsair,
SeaDog,
Stormbird,
Ayssid,
SeaWitch,
Sorceress,
Nix,
NixWarrior,
SeaSerpent,
Haspid,
Satyr,
Fangarm,
Ballista,
Cannon,
Leprechaun,
SteelGolem,
}

export enum Spells {
MagicArrow = 1,
Visions,
Bloodlust,
Curse,
ProtectionFromFire,
Blind,
Firewall,
Fireball,
LandMine,
Misfortune,
Armageddon,
Berserk,
FireShield,
Frenzy,
Inferno,
Slayer,
Sacrifice,
SummonFireElemental,
Bless,
Cure,
Dispel,
ProtectionFromWater,
SummonBoat,
IceBolt,
RemoveObstacle,
ScuttleBoat,
Weakness,
Forgetfulness,
FrostRing,
Mirth,
Teleport,
Clone,
Prayer,
WaterWalk,
SummonWaterElemental,
Shield,
Slow,
StoneSkin,
ViewEarth,
DeathRipple,
Quicksand,
AnimateDead,
AntiMagic,
Earthquake,
ForceField,
ProtectionFromEarth,
MeteorShower,
Resurrection,
Sorrow,
TownPortal,
Implosion,
SummonEarthElemental,
Haste,
ViewAir,
Disguise,
DisruptingRay,
Fortune,
LightningBolt,
Precision,
ProtectionFromAir,
AirShield,
DestroyUndead,
Hypnotize,
ChainLightning,
Counterstrike,
DimensionDoor,
Fly,
MagicMirror,
SummonAirElemental,
TitansLightningBolt,
}

export enum Classes {
Knight = 1,
Cleric,
Ranger,
Druid,
Alchemist,
Wizard,
Demoniac,
Heretic,
DeathKnight,
Necromancer,
Overlord,
Warlock,
Barbarian,
BattleMage,
Beastmaster,
Witch,
Planeswalker,
Elementalist,
Captain,
Navigator,
}

0 comments on commit 0789647

Please sign in to comment.