Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated to latest
  • Loading branch information
kennyqiyenkan committed Sep 18, 2016
2 parents a03122d + 4507002 commit af6eff3
Show file tree
Hide file tree
Showing 24 changed files with 329 additions and 152 deletions.
4 changes: 3 additions & 1 deletion Project-Uragon/app/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ typings
.tscache

app/**/*.js
app/**/*.map
app/**/*.js.map
app/*.js
app/*.js.map
platforms
lib

Expand Down
2 changes: 1 addition & 1 deletion Project-Uragon/app/App_Resources/Android/app.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android {
defaultConfig {
generatedDensities = []
applicationId = "org.nativescript.ProjectUragon"
applicationId = "__PACKAGE__"
}
aaptOptions {
additionalParameters "--no-version-vectors"
Expand Down
2 changes: 2 additions & 0 deletions Project-Uragon/app/App_Resources/iOS/build.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// You can add custom settings here
// for example you can uncomment the following line to force distribution code signing
// CODE_SIGN_IDENTITY = iPhone Distribution
// To build for device with XCode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
// DEVELOPMENT_TEAM = YOUR_TEAM_ID;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
7 changes: 0 additions & 7 deletions Project-Uragon/app/app.component.html

This file was deleted.

32 changes: 0 additions & 32 deletions Project-Uragon/app/app.component.js

This file was deleted.

1 change: 0 additions & 1 deletion Project-Uragon/app/app.component.js.map

This file was deleted.

28 changes: 11 additions & 17 deletions Project-Uragon/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import {Component} from "@angular/core";
import { Component, OnInit } from "@angular/core";

@Component({
selector: "my-app",
templateUrl: "app.component.html",
selector: "main",
template: "<page-router-outlet></page-router-outlet>"
})
export class AppComponent {
public counter: number = 16;

public get message(): string {
if (this.counter > 0) {
return this.counter + " taps left";
} else {
return "Hoorraaay! \nYou are ready to start building!";
}
}

public onTap() {
this.counter--;
}
export class AppComponent implements OnInit
{
ngOnInit()
{
console.log(`
DEBUG: AppComponent - ngOnInit()
`);
}
}
32 changes: 32 additions & 0 deletions Project-Uragon/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { NgModule, OnInit } from "@angular/core";
import { NativeScriptFormsModule } from "nativescript-angular/forms";
import { NativeScriptHttpModule } from "nativescript-angular/http";
import { NativeScriptModule } from "nativescript-angular/platform";
import { NativeScriptRouterModule } from "nativescript-angular/router";

import { AppComponent } from "./app.component";
import { routes, navigatableComponents } from "./app.routing";

@NgModule({
imports: [
NativeScriptModule,
NativeScriptFormsModule,
NativeScriptHttpModule,
NativeScriptRouterModule,
NativeScriptRouterModule.forRoot(routes)
],
declarations: [
AppComponent,
...navigatableComponents
],
bootstrap: [AppComponent]
})
export class AppModule implements OnInit
{
ngOnInit()
{
console.log(`
DEBUG: AppModule - ngOnInit()
`);
}
}
12 changes: 12 additions & 0 deletions Project-Uragon/app/app.routing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { LoginComponent } from "./pages/login/login.component";
import { RegistrationComponent } from "./pages/registration/registration.component";

export const routes = [
{ path: "", component: LoginComponent },
{ path: "registration", component: RegistrationComponent }
];

export const navigatableComponents = [
LoginComponent,
RegistrationComponent
];
6 changes: 0 additions & 6 deletions Project-Uragon/app/main.js

This file was deleted.

1 change: 0 additions & 1 deletion Project-Uragon/app/main.js.map

This file was deleted.

7 changes: 3 additions & 4 deletions Project-Uragon/app/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// this import should be first in order to load some required settings (like globals and reflect-metadata)
import {nativeScriptBootstrap} from "nativescript-angular/application";
import {AppComponent} from "./app.component";
import { platformNativeScriptDynamic, NativeScriptModule } from "nativescript-angular/platform";
import { AppModule } from "./app.module";

nativeScriptBootstrap(AppComponent);
platformNativeScriptDynamic().bootstrapModule(AppModule);
29 changes: 14 additions & 15 deletions Project-Uragon/app/model/creature/stats/mainStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,20 @@ export class MainStats

public toJSON()
{
return
{
StatsEnum.STRENGTH:this.str,
StatsEnum.INTELLIGENCE:this.int,
StatsEnum.DEXTERITY:this.dex,
StatsEnum.VITALITY:this.vit,
StatsEnum.AGILITY:this.agi,
StatsEnum.LUCK:this.luk,
StatsEnum.STRENGTH_MOD:this.strMod,
StatsEnum.INTELLIGENCE_MOD:this.intMod,
StatsEnum.DEXTERITY_MOD:this.dexMod,
StatsEnum.VITALITY_MOD:this.vitMod,
StatsEnum.AGILITY_MOD:this.agiMod,
StatsEnum.LUCK_MOD:this.lukMod
};
var json = `{
${StatsEnum.STRENGTH}:${this.str},
${StatsEnum.INTELLIGENCE}:${this.int},
${StatsEnum.DEXTERITY}:${this.dex},
${StatsEnum.VITALITY}:${this.vit},
${StatsEnum.AGILITY}:${this.agi},
${StatsEnum.LUCK}:${this.luk},
${StatsEnum.STRENGTH_MOD}:${this.strMod},
${StatsEnum.INTELLIGENCE_MOD}:${this.intMod},
${StatsEnum.DEXTERITY_MOD}:${this.dexMod},
${StatsEnum.VITALITY_MOD}:${this.vitMod},
${StatsEnum.AGILITY_MOD}:${this.agiMod},
${StatsEnum.LUCK_MOD}:${this.lukMod}
}`;
}

public getSTR() { return (this.str + this.strMod); }
Expand Down
71 changes: 56 additions & 15 deletions Project-Uragon/app/model/creature/stats/secondaryStats.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MainStats } from "./mainStats";
import { StatsEnum } from "./statsEnum";
export class SecondaryStats
{
private hp:number; //- Health Points (HP)
Expand All @@ -13,27 +14,67 @@ export class SecondaryStats

private phDef:number; //- Physical Defense (Ph. Def.)
private mgDef:number; //- Magical Defense (Mg. Def.)
private dc:number; //- Dodge Chance (D. C.) in %
private dCh:number; //- Dodge Chance (D. C.) in %

private init:number; //- Initiative

constructor() //base constructor
constructor()
constructor(json:any)
constructor(json?:any)
{
this.hp = 0;
this.mp = 0;
this.sp = 0;
if(json)
{
this.hp = json[StatsEnum.HEALTH_POINTS];
this.mp = json[StatsEnum.MANA_POINTS];
this.sp = json[StatsEnum.STAMINA_POINTS];

this.phAtk = 0;
this.mgAtk = 0;
this.rgAtk = 0;
this.critCh = 0;
this.acc = 0;
this.phAtk = json[StatsEnum.PHYSICAL_ATTACK];
this.mgAtk = json[StatsEnum.MAGICAL_ATTACK];
this.rgAtk = json[StatsEnum.RANGED_ATTACK];
this.critCh = json[StatsEnum.CRITICAL_CHANCE];
this.acc = json[StatsEnum.ACCURACY];

this.phDef = 0;
this.mgDef = 0;
this.dc = 0;
this.phDef = json[StatsEnum.PHYSICAL_DEFENCE];
this.mgDef = json[StatsEnum.MAGICAL_DEFENCE];
this.dCh = json[StatsEnum.DODGE_CHANCE];

this.init = 0;
this.init = json[StatsEnum.INITIATIVE];
}else{
this.hp = 0;
this.mp = 0;
this.sp = 0;

this.phAtk = 0;
this.mgAtk = 0;
this.rgAtk = 0;
this.critCh = 0;
this.acc = 0;

this.phDef = 0;
this.mgDef = 0;
this.dCh = 0;

this.init = 0;
}
}

public toJSON()
{
var json = `{
${StatsEnum.HEALTH_POINTS}:${this.hp},
${StatsEnum.MANA_POINTS}:${this.mp},
${StatsEnum.STAMINA_POINTS}:${this.sp},
${StatsEnum.PHYSICAL_ATTACK}:${this.phAtk},
${StatsEnum.MAGICAL_ATTACK}:${this.mgAtk},
${StatsEnum.RANGED_ATTACK}:${this.rgAtk},
${StatsEnum.CRITICAL_CHANCE}:${this.critCh},
${StatsEnum.ACCURACY}:${this.acc},
${StatsEnum.PHYSICAL_DEFENCE}:${this.phDef},
${StatsEnum.MAGICAL_DEFENCE}:${this.mgDef},
${StatsEnum.DODGE_CHANCE}:${this.dCh},
${StatsEnum.INITIATIVE}:${this.init}
}`;
return json;
}

public calculateSecondaryStats(mainStats:MainStats)
Expand All @@ -50,7 +91,7 @@ export class SecondaryStats

this.phDef = mainStats.getVIT() * 50; //phAtk per VIT point
this.mgDef = mainStats.getINT() * 50; //mgAtk per INT point
this.dc = ((mainStats.getAGI() * 10) / 1000) * 100; //dc%
this.dCh = ((mainStats.getAGI() * 10) / 1000) * 100; //dc%

this.init = mainStats.getAGI(); //For now, they will be the same
}
Expand Down
44 changes: 30 additions & 14 deletions Project-Uragon/app/model/creature/stats/statsEnum.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
export enum StatsEnum
{
STRENGTH = "str",
INTELLIGENCE = "int",
DEXTERITY = "dex",
VITALITY = "vit",
AGILITY = "agi",
LUCK = "luk",
STRENGTH_MOD = "strMod",
INTELLIGENCE_MOD = "intMod",
DEXTERITY_MOD = "dexMod",
VITALITY_MOD = "vitMod",
AGILITY_MOD = "agiMod",
LUCK_MOD = "lukMod"
export class StatsEnum
{//Class because.. Typescript..
//Main Stats
static STRENGTH = "str";
static INTELLIGENCE = "int";
static DEXTERITY = "dex";
static VITALITY = "vit";
static AGILITY = "agi";
static LUCK = "luk";

static STRENGTH_MOD = "strMod";
static INTELLIGENCE_MOD = "intMod";
static DEXTERITY_MOD = "dexMod";
static VITALITY_MOD = "vitMod";
static AGILITY_MOD = "agiMod";
static LUCK_MOD = "lukMod";

//Secondary Stats
static HEALTH_POINTS = "hp";
static MANA_POINTS = "mp";
static STAMINA_POINTS = "sp";
static PHYSICAL_ATTACK = "phAtk";
static MAGICAL_ATTACK = "mgAtk";
static RANGED_ATTACK = "rgAtk";
static CRITICAL_CHANCE = "critCh";
static ACCURACY = "acc";
static PHYSICAL_DEFENCE = "phDef";
static MAGICAL_DEFENCE = "mgDef";
static DODGE_CHANCE = "dCh";
static INITIATIVE = "init";
}
27 changes: 13 additions & 14 deletions Project-Uragon/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"name": "tns-template-hello-world-ng",
"main": "main.js",
"version": "2.2.3",
"version": "2.3.0",
"author": "Telerik <support@telerik.com>",
"description": "Nativescript Angular Hello World template",
"license": "BSD",
Expand All @@ -28,21 +28,20 @@
"v8Flags": "--expose_gc"
},
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/platform-server": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.2",
"@angular/router-deprecated": "2.0.0-rc.2",
"reflect-metadata": "^0.1.5",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",
"nativescript-angular": "^0.3.0"
"nativescript-angular": "1.0.0",
"@angular/core": "2.0.0",
"@angular/common": "2.0.0",
"@angular/compiler": "2.0.0",
"@angular/http": "2.0.0",
"@angular/platform-browser": "2.0.0",
"@angular/platform-browser-dynamic": "2.0.0",
"@angular/platform-server": "2.0.0",
"@angular/forms": "2.0.0",
"@angular/router": "3.0.0",
"reflect-metadata": "^0.1.8"
},
"devDependencies": {
"zone.js": "^0.6.21",
"nativescript-dev-typescript": "^0.3.2"
}
}
Loading

0 comments on commit af6eff3

Please sign in to comment.