From 004619d6ddc0afabf0d999cf65aeddeb02c2fc77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Wed, 23 Dec 2020 13:06:01 +0100 Subject: [PATCH 01/26] SES-114 Adder Errors to register view and user can no longer register with two different passwords --- .../registration/registration.component.ts | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.ts index 5532c93..f3ebc93 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.ts @@ -6,7 +6,6 @@ import {Subscription} from 'rxjs'; import {ErrorResponse} from '../../../types/ErrorResponse'; import {UserRegisterViewModel} from '../../../types/viewmodels/user-viewmodels/UserRegisterViewModel'; import {HttpErrorResponse} from '@angular/common/http'; -import {type} from 'os'; @Component({ selector: 'app-registration', @@ -36,27 +35,33 @@ export class RegistrationComponent implements OnDestroy { } Register() { - const userRegisterModel = new class implements UserRegisterViewModel { - password: string; - username: string; - }; + if (this.signUpFormGroup.valid) { + const userRegisterModel = new class implements UserRegisterViewModel { + password: string; + username: string; + }; - userRegisterModel.username = this.signUpFormGroup.get('newAccount').value['username']; - userRegisterModel.password = this.signUpFormGroup.get('newAccount').value['password']; + userRegisterModel.username = this.signUpFormGroup.get('newAccount').value['username']; + userRegisterModel.password = this.signUpFormGroup.get('newAccount').value['password']; - this.allSubscriptions.add( - this.userService.registerUser(userRegisterModel).subscribe( - () => { - this.router.navigate(['login']); - }, - (error: ErrorResponse | HttpErrorResponse) => { - if (error instanceof HttpErrorResponse) { - error = error.error as ErrorResponse; + this.allSubscriptions.add( + this.userService.registerUser(userRegisterModel).subscribe( + () => { + this.router.navigate(['login']); + }, + (error: ErrorResponse | HttpErrorResponse) => { + if (error instanceof HttpErrorResponse) { + error = error.error as ErrorResponse; + } + this.apiError = true; + this.apiErrorMessage = error.message; } - this.apiError = true; - this.apiErrorMessage = error.message; - } - )); + )); + } else { + this.signUpFormGroup.get('newAccount').get('username').markAsTouched(); + this.signUpFormGroup.get('newAccount').get('password').markAsTouched(); + this.signUpFormGroup.get('newAccount').get('confirmPassword').markAsTouched(); + } } ngOnDestroy() { From b9c44c91206c03c3adbbb8f50211b830caaf6ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 16:25:00 +0100 Subject: [PATCH 02/26] SES-123 Icons module added --- .../src/app/shared/sc-icons/how-to.RMD | 0 ...ession-companion-icons-registry.service.ts | 0 .../session-companion-icons.component.ts | 20 ++++++++++++++++++ .../session-companion-icons.module.ts | 10 +++++++++ .../src/app/shared/sc-icons/warning.png | Bin 0 -> 3385 bytes 5 files changed, 30 insertions(+) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD new file mode 100644 index 0000000..e69de29 diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts new file mode 100644 index 0000000..e69de29 diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts new file mode 100644 index 0000000..701f5b6 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts @@ -0,0 +1,20 @@ +import {ChangeDetectionStrategy, Component, ElementRef, Input} from '@angular/core'; + +@Component({ + selector: 'app-sc-icons', + template: ` + + `, + styles: [':host::ng-deep svg{width: 50px; height: 50px}'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class SessionCompanionIcons { + + @Input() + set name(iconName: string) { + this.element.nativeElement.innerHTML = scIcons[iconName] || null; + } + + constructor(private element: ElementRef) { + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts new file mode 100644 index 0000000..b79dae7 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts @@ -0,0 +1,10 @@ +import {NgModule} from '@angular/core'; +import {SessionCompanionIconsComponent} from './session-companion-icons.component'; + +@NgModule({ + declarations: [SessionCompanionIconsComponent], + imports: [], + exports: [] +}) +export class SessionCompanionIconsModule { +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png new file mode 100644 index 0000000000000000000000000000000000000000..d36ffcbb6a41427fd8599e13f441f4286f73b6ce GIT binary patch literal 3385 zcma)p@b#@;&+nh#AHP5D`*mH{{rcSZ{kmS){kq>*hMUW2IT>{s zF)=Z@KOF5m#Ka^(+xG9$QrokFBKpyGTTVxoC8L0Vi{ zRta#PdQ$dQdWyNp8|jptF#A07H3G1!%@!05B$yb&51JfNe#2bbX9rT&kpd7po(8=$ z{_S@KsbDL=gm2EhbuWf4^A{kPKEV!X10R0(`Rav=myHdK;Mw(}DDC)!gg+HdO8<6K zfl#Ei2lT@_nf~nQ!=J&E&LQq@<5yWZzuedwUENCD>c4JT%1?!~@!o&MUH>a~ko>iI zph@2D+YEGAC~EVGRa`YwFL z=h)C9tCYIrl_!5fUlp}^q1Crg8Hr^1`frqwxK_wu8vTN^X#H@YpafJ2Y=>LDgWE zc3#U#(q5%hyL^4Ht%1SxG=b(Qy-)!m(S6~Ps^ebai} zZe3lM2bL#_srl_C+^mXO+Vq`~t8hejh_0Cdp=(w++c=*AUiV;)NAwS2b8W7d zcjO$N&-Y-t2P#`?{^?utT5}968R^rP8uul}?NiMHl9Jy8WcFdv4&JAG8f0WZvWyZR z6_9El*bk(9*Doom9u=RsD3X{mHt>Q46q|2Wx`QXp8Vrx_dpA+KJ^(jzuDXD|HD$5J zk`>-+TcTyi|3i%FTsUnylBQIS@5PgS^Hu04VSf>}TqdmC zJTjfPb;R6g)8M|s*TQy}(J`wM# zPF++qyx%4vgghLF%7nzP6)YrcFpCcmp@*8kwn9#uinD{Xail#E{j7*4CZ?!OM5!;5 zM@MqLSv>4@DbQ(x6!Nx5MJHYtuAQUBCrwK*=>D=iHTt0jzfAEt2Ts-1cVm<+`EK>c zP5lH3KmNK{qgQIL;~+4vHTB`5S+zI+pY!Q7LWmpiY)?%rp0$fO=BY=u;xU5F0a z-+L^aJc$@e#q6L~dJ+u9}=bE1!CkY}LJ4^D0-^^S4QSdW_R}XC;Es^fxGHk_{7fXF#VZVP~`Yte= z-vgQy`l;b76t|5aFlOS!hO@LZfVO1xx(>z1El(v&N=^dJAN$+Cmwy{3Aux8oUSm-s zES!ig4(n5L$3^S)-vq`eta2V-&T$5?)#h~I82$RDJ+{{iT2rN{e54&V)sZXBGghZVh%)peJ`%zZyJY?T+MV>AVXcaLd`V#s^80Jf z^!OytBG%|f+Wr=_Bc87sDz?konVN4F=RFpL2TxTC_pKdITGe8yIpT*n~ikG`yJo9lq7;_E4vi69E-&s3v;u7C9HZks;xk& zDZjwN1ZS>7loNK(S5!Ul&|qE1^wm8pDu^6hkl@h^@8>CoNCf%MzB;3-x)=#eYB9md z=3KhsduG9i>3t>=4j7?bqLFtp(Tcg1)R|5fiWz2nSsPjCG6znN%}$S2MWv`- z$eDr&0WxPeI9?xOZ8~t9ez*B^O`?;ZS}zOF_tK1W_*&9 z<%kpmi!goUFy9xwDkIwI6vlc=C*6^yUI++U%7nlXh#3qGavGcev^@ng$?If;v}`FQ z1+|_gEvU0EHxGCj>QvK`69&0$d4k*zfLwelN1?s(c&Odk;rsIMGF#TVRtO>8*Uv7{ zmzOD@%f4nnmdYsQas9q-ldi>;hjshlX4ZmtWXY{ZwKe=~`rWFOPkpzx;`CEK>N!fM zBX<9_iS&qeyWk$cJI zDer4(8P`~0%-<}Rk|zZbF5EP3JG$B!OJxA4{8@MbX*+>yamdZW@)x3$G|r55D`vCc zJ;!r@|9D3-*nglD$gJ-y7r?!vZw=F8v-?(bx5Vjhhu(2Ad+~m%qf)cyRB(+)Z3aw| z0t0wxp|7PKGO@>W))q*7lEy9J+v{25X=D?PFNn=MBF=#^!&V-$_9(A3F6=|m0TFx3 z)NMd~%4dEsB7c1u%e`}LFevG=-%}s!{TfK7uN!r~TrXptZFwkabZ-=D9);co0@XDO zbbM1s-BvN+xzRL} z8V;?b45_0F_fk6?0c!_f^(a7AV7O zC2Ht>$noAZ=V9H1@EGf!G*2ya?Q!`2A_iwNND{h?r_7_5rZ5YaqLQtMaU4Obar&n> z+#>vFvp>ojT0aV)(n-B+;81Vdl#UfOGy>91F7P5(cxIQ8uQRS~f8OE9HHaDl89Wy1 z|3MQlF*DB~X35<2!rt=XMCvXQ)#sFM(Q{fC@hZMM{Zdo(TzeIZ*(zj^}MLmV{W$Y?n%w#1n8Bq^1#kVpn<6KjlB4!KmN> literal 0 HcmV?d00001 From 607145f45f38908f5e7c6b43369fdcb44788426e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 16:25:12 +0100 Subject: [PATCH 03/26] Icon module register --- .../ClientApp/package-lock.json | 701 +++++++++++++++++- .../SessionCompanion/ClientApp/package.json | 14 + .../ClientApp/src/app/app.module.ts | 3 +- .../select-role/select-role.component.ts | 3 +- .../components/sign-in/sign-in.component.ts | 12 +- .../src/app/shared/sc-icons/how-to.RMD | 29 + .../shared/sc-icons/icons/sc-icon.model.ts | 105 +++ .../sc-icons/icons/svg-icons/barbarian.svg | 1 + .../shared/sc-icons/icons/svg-icons/bard.svg | 1 + .../sc-icons/icons/svg-icons/cleric.svg | 1 + .../shared/sc-icons/icons/svg-icons/druid.svg | 1 + .../sc-icons/icons/svg-icons/fighter.svg | 1 + .../shared/sc-icons/icons/svg-icons/monk.svg | 1 + .../sc-icons/icons/svg-icons/paladin.svg | 1 + .../sc-icons/icons/svg-icons/ranger.svg | 1 + .../shared/sc-icons/icons/svg-icons/rogue.svg | 1 + .../sc-icons/icons/svg-icons/sorcerer.svg | 1 + .../sc-icons/icons/svg-icons/warlock.svg | 1 + .../sc-icons/icons/svg-icons/wizard.svg | 1 + ...ession-companion-icons-registry.service.ts | 31 + .../session-companion-icons.component.ts | 24 +- .../session-companion-icons.module.ts | 4 +- 22 files changed, 920 insertions(+), 18 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg diff --git a/SessionCompanion/SessionCompanion/ClientApp/package-lock.json b/SessionCompanion/SessionCompanion/ClientApp/package-lock.json index e784a87..a4391a2 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package-lock.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package-lock.json @@ -2976,6 +2976,12 @@ "integrity": "sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA==", "dev": true }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, "@types/q": { "version": "0.0.32", "resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", @@ -3874,6 +3880,12 @@ "multicast-dns-service-types": "^1.1.0" } }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, "bootstrap": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.1.tgz", @@ -4309,6 +4321,12 @@ "restore-cursor": "^3.1.0" } }, + "cli-spinners": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.5.0.tgz", + "integrity": "sha512-PC+AmIuK04E6aeSs/pUccSujsTzBhu4HzC2dL+CfJB/Jcc2qTRbEwZQDfIUpt2Xl8BodYBEq8w4fc0kU2I9DjQ==", + "dev": true + }, "cli-width": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", @@ -4343,6 +4361,54 @@ "shallow-clone": "^3.0.0" } }, + "coa": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", + "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", + "dev": true, + "requires": { + "@types/q": "^1.5.1", + "chalk": "^2.4.1", + "q": "^1.1.2" + }, + "dependencies": { + "@types/q": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", + "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -4881,6 +4947,24 @@ "integrity": "sha1-Mh9s9zeCpv91ERE5D8BeLGV9jJs=", "dev": true }, + "css-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.1.0.tgz", + "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "^3.2.1", + "domutils": "^1.7.0", + "nth-check": "^1.0.2" + } + }, + "css-select-base-adapter": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", + "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", + "dev": true + }, "css-selector-tokenizer": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz", @@ -4932,6 +5016,30 @@ } } }, + "css-tree": { + "version": "1.0.0-alpha.37", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", + "integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==", + "dev": true, + "requires": { + "mdn-data": "2.0.4", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "css-what": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz", + "integrity": "sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==", + "dev": true + }, "cssauron": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/cssauron/-/cssauron-1.4.0.tgz", @@ -4941,6 +5049,39 @@ "through": "X.X.X" } }, + "csso": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", + "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "dev": true, + "requires": { + "css-tree": "^1.1.2" + }, + "dependencies": { + "css-tree": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.2.tgz", + "integrity": "sha512-wCoWush5Aeo48GLhfHPbmvZs59Z+M7k5+B1xDnXbdWNcEF423DoFdqSWE0PM5aNk5nI5cp1q7ms36zGApY/sKQ==", + "dev": true, + "requires": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + } + }, + "mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -5048,6 +5189,23 @@ } } }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + }, + "dependencies": { + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + } + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -5254,6 +5412,24 @@ "void-elements": "^2.0.0" } }, + "dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dev": true, + "requires": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz", + "integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==", + "dev": true + } + } + }, "domain-browser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", @@ -5275,11 +5451,27 @@ "isomorphic-fetch": "^2.2.1" } }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, "domino": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/domino/-/domino-2.1.4.tgz", "integrity": "sha512-l70mlQ7IjPKC8kT7GljQXJZmt5OqFL+RE91ik5y5WWQtsd9wP8R7gpFnNu96fK5MqAAZRXfLLsnzKtkty5fWGQ==" }, + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, "duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -5493,6 +5685,12 @@ "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", "dev": true }, + "entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "dev": true + }, "err-code": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", @@ -7177,6 +7375,12 @@ "is-extglob": "^2.1.1" } }, + "is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true + }, "is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", @@ -8036,6 +8240,12 @@ "immediate": "~3.0.5" } }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, "load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -8087,12 +8297,90 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, + "lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=", + "dev": true + }, + "lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=", + "dev": true + }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "log4js": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/log4js/-/log4js-4.5.1.tgz", @@ -8267,6 +8555,12 @@ "safe-buffer": "^5.1.2" } }, + "mdn-data": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", + "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", + "dev": true + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -8954,6 +9248,15 @@ "set-blocking": "~2.0.0" } }, + "nth-check": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", + "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "dev": true, + "requires": { + "boolbase": "~1.0.0" + } + }, "num2fraction": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", @@ -9151,6 +9454,73 @@ "isobject": "^3.0.1" } }, + "object.values": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", + "integrity": "sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", + "dev": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + } + } + }, "obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -9225,6 +9595,88 @@ "is-wsl": "^1.1.0" } }, + "ora": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.1.0.tgz", + "integrity": "sha512-9tXIMPvjZ7hPTbk8DFq1f7Kow/HU/pQYB60JbNq+QnGwcyhWVZaQ4hM9zQDEsPxw/muLpgiHSaumUZxCAmod/w==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.4.0", + "is-interactive": "^1.0.0", + "log-symbols": "^4.0.0", + "mute-stream": "0.0.8", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "original": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", @@ -9413,6 +9865,23 @@ "readable-stream": "^2.1.5" } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + } + } + }, "parse-asn1": { "version": "5.1.5", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", @@ -9747,6 +10216,12 @@ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", "dev": true }, + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "dev": true + }, "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", @@ -10051,8 +10526,7 @@ "q": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", - "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", - "optional": true + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=" }, "qjobs": { "version": "1.2.0", @@ -10603,8 +11077,7 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "optional": true + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "schema-utils": { "version": "1.0.0", @@ -11450,6 +11923,12 @@ "figgy-pudding": "^3.5.1" } }, + "stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", + "dev": true + }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -11729,6 +12208,187 @@ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "optional": true }, + "svg-to-ts": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/svg-to-ts/-/svg-to-ts-6.0.0.tgz", + "integrity": "sha512-QdznpIJfuTjP//zY007BhOYAe4ZOII1XviNgmvhgfEnl6MxTyLJWL20JgECvjGJHD+F8DqKOnt7YU7UmUFD6LQ==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "commander": "^4.0.1", + "cosmiconfig": "^6.0.0", + "glob": "^7.1.6", + "lodash.camelcase": "^4.3.0", + "lodash.kebabcase": "^4.1.1", + "lodash.snakecase": "^4.1.1", + "ora": "^5.1.0", + "prettier": "^1.19.1", + "svgo": "^1.3.2", + "typescript": "^3.7.2" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true + }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "parse-json": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "typescript": { + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "dev": true + } + } + }, + "svgo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz", + "integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "coa": "^2.0.2", + "css-select": "^2.0.0", + "css-select-base-adapter": "^0.1.1", + "css-tree": "1.0.0-alpha.37", + "csso": "^4.0.2", + "js-yaml": "^3.13.1", + "mkdirp": "~0.5.1", + "object.values": "^1.1.0", + "sax": "~1.2.4", + "stable": "^0.1.8", + "unquote": "~1.1.1", + "util.promisify": "~1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", @@ -12200,6 +12860,12 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, + "unquote": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", + "dev": true + }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -12324,6 +12990,18 @@ "object.getownpropertydescriptors": "^2.0.3" } }, + "util.promisify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + } + }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -13088,6 +13766,15 @@ "minimalistic-assert": "^1.0.0" } }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, "webdriver-js-extender": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz", @@ -14305,6 +14992,12 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "optional": true }, + "yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "dev": true + }, "yargs": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", diff --git a/SessionCompanion/SessionCompanion/ClientApp/package.json b/SessionCompanion/SessionCompanion/ClientApp/package.json index 8d97cb5..35cdd9e 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package.json @@ -6,10 +6,23 @@ "start": "ng serve", "build": "ng build", "build:ssr": "ng run SessionCompanion:server:dev", + "generate-icons": "svg-to-ts", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, + "svg-to-ts": { + "conversionType": "constants", + "srcFiles": [ + "./src/app/shared/sc-icons/icons/**/*.svg" + ], + "outputDirectory": "./src/app/shared/sc-icons/icons", + "interfaceName": "SessionCompanionIcon", + "typeName": "scIcon", + "prefix": "scIcon", + "fileName": "sc-icon.model", + "compileSources": true + }, "private": true, "dependencies": { "@angular/animations": "8.2.12", @@ -53,6 +66,7 @@ "karma-coverage-istanbul-reporter": "~2.1.0", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.2", + "svg-to-ts": "^6.0.0", "typescript": "3.5.3" }, "optionalDependencies": { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index 6bed2fc..74d137e 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -23,9 +23,9 @@ import { import {UserService} from '../services/user.service'; import { StoreModule } from '@ngrx/store'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; -import { reducers} from './reducers'; import {AppReducer} from './store/reducers/app.reducer'; import {environment} from '../environments/environment'; +import {SessionCompanionIconsModule} from './shared/sc-icons/session-companion-icons.module'; @NgModule({ declarations: [ @@ -54,6 +54,7 @@ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), MatSidenavModule, MatToolbarModule, MatListModule, + SessionCompanionIconsModule, StoreModule.forRoot({appState: AppReducer}), StoreDevtoolsModule.instrument({ logOnly: environment.production diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-role/select-role.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-role/select-role.component.ts index 12bb627..1565301 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-role/select-role.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-role/select-role.component.ts @@ -12,7 +12,8 @@ import {AddRole} from '../../store/actions/app.actions'; export class SelectRoleComponent { isExpanded = false; - constructor(private router: Router, private store: Store<{ role: string }>) {} + constructor(private router: Router, private store: Store<{ role: string }>) { + } collapse() { this.isExpanded = false; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts index 16ac96e..d9c24be 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts @@ -43,7 +43,7 @@ export class SignInComponent implements OnDestroy, OnInit { onLoginButtonClick() { let role = ''; - this.store.select(s => s.appState.role).subscribe((v)=>{ + this.store.select(s => s.appState.role).subscribe((v) => { role = v; }); this.allSubscriptions.add( @@ -52,7 +52,6 @@ export class SignInComponent implements OnDestroy, OnInit { this.signInFormGroup.get('signIn').value['password']).subscribe( (success) => { this.store.dispatch(new AddUserId({userId: success})); - //TODO zmienić na jedna linie if (role === 'player') { this.router.navigate(['select-character']); } else { @@ -69,13 +68,12 @@ export class SignInComponent implements OnDestroy, OnInit { )); } - onRegisterButtonClick(){ - this.router.navigate(['register']) - //TODO connect with backend + onRegisterButtonClick() { + this.router.navigate(['register']); } - onArrowBackClick(){ - this.router.navigate(['']) + onArrowBackClick() { + this.router.navigate(['']); } collapse() { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD index e69de29..5ba5504 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD @@ -0,0 +1,29 @@ +Moduł został już dodany i wstrzyknięty do roota apki. + +Aby dodać nową ikonkę, plik svg wstawiamy do folderu icons/svg-icons. +Następnie wpisujemy w konsoli polecenie: +npm run generate-icons + +Zostaną wtedy utworzone nowe klasy z dodaną ikonką. + +Jeśli po tym będziemy chcieli użyć gdzieś naszej ikonki, nie pojawi się ona... +Jest to spowodowane tym, że nie chcemy, aby aplikacja wczytywała w jednym momencie wszystkie nasze ikonki a jedynie te potrzebne +Musi więc ją dodać w odpowiednim momencie do rejestru, w innym wypadku w konsoli dostaniemy komunikat: +![img.png](warning.png) + +Teraz zarejestrujmy naszą ikonkę: + +Dodajemy w konstruktorze danego komponentu: +```typescript +iconRegister: SessionCompanionIconsRegistry +``` + +Następnie dodajemy interesującą nas ikonkę: +```typescript +this.iconRegister.registerIcon(scIconBarbarian); +``` + +Samą ikonkę ładujemy w tagu +```html + +``` diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts new file mode 100644 index 0000000..840ea40 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts @@ -0,0 +1,105 @@ +/* 🤖 this file was generated by svg-to-ts*/ +export const scIconBarbarian: { + name: 'barbarian'; + data: string; +} = { + name: 'barbarian', + data: `` +}; +export const scIconBard: { + name: 'bard'; + data: string; +} = { + name: 'bard', + data: `` +}; +export const scIconCleric: { + name: 'cleric'; + data: string; +} = { + name: 'cleric', + data: `` +}; +export const scIconDruid: { + name: 'druid'; + data: string; +} = { + name: 'druid', + data: `` +}; +export const scIconFighter: { + name: 'fighter'; + data: string; +} = { + name: 'fighter', + data: `` +}; +export const scIconMonk: { + name: 'monk'; + data: string; +} = { + name: 'monk', + data: `` +}; +export const scIconPaladin: { + name: 'paladin'; + data: string; +} = { + name: 'paladin', + data: `` +}; +export const scIconRanger: { + name: 'ranger'; + data: string; +} = { + name: 'ranger', + data: `` +}; +export const scIconRogue: { + name: 'rogue'; + data: string; +} = { + name: 'rogue', + data: `` +}; +export const scIconSorcerer: { + name: 'sorcerer'; + data: string; +} = { + name: 'sorcerer', + data: `` +}; +export const scIconWarlock: { + name: 'warlock'; + data: string; +} = { + name: 'warlock', + data: `` +}; +export const scIconWizard: { + name: 'wizard'; + data: string; +} = { + name: 'wizard', + data: `` +}; +export type scIcon = + | 'barbarian' + | 'bard' + | 'cleric' + | 'druid' + | 'fighter' + | 'monk' + | 'paladin' + | 'ranger' + | 'rogue' + | 'sorcerer' + | 'warlock' + | 'wizard'; +export interface SessionCompanionIcon { + name: scIcon; + data: string; +} +export type SessionCompanionIconNameSubset< + T extends Readonly +> = T[number]['name']; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg new file mode 100644 index 0000000..a4d948e --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg new file mode 100644 index 0000000..565ebe9 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg new file mode 100644 index 0000000..df1b7e5 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg new file mode 100644 index 0000000..036adc9 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg new file mode 100644 index 0000000..4fa6997 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg new file mode 100644 index 0000000..3590be6 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg new file mode 100644 index 0000000..0fb47a7 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg new file mode 100644 index 0000000..4d9aca2 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg new file mode 100644 index 0000000..2e89550 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg new file mode 100644 index 0000000..e26b851 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg new file mode 100644 index 0000000..329c82f --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg new file mode 100644 index 0000000..c61b956 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts index e69de29..0870b10 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts @@ -0,0 +1,31 @@ +import {Injectable} from '@angular/core'; +import { SessionCompanionIcon } from './icons/sc-icon.model'; + +@Injectable({ + providedIn: 'root' +}) +export class SessionCompanionIconsRegistry { + + private registry = new Map(); + + public registerIcons(icons: SessionCompanionIcon[]): void { + icons.forEach((icon: SessionCompanionIcon) => { + if (!this.registry.has(icon.name)) { + this.registry.set(icon.name, icon.data); + } + }); + } + + public registerIcon(icon: SessionCompanionIcon): void { + if (!this.registry.has(icon.name)) { + this.registry.set(icon.name, icon.data); + } + } + + public getIcon(iconName: string): string | undefined { + if (!this.registry.has(iconName)) { + console.warn(`We could not find the Icon with the name ${iconName}, did you add it to the Icon registry?`); + } + return this.registry.get(iconName); + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts index 701f5b6..5752798 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts @@ -1,4 +1,6 @@ -import {ChangeDetectionStrategy, Component, ElementRef, Input} from '@angular/core'; +import {ChangeDetectionStrategy, Component, ElementRef, Inject, Input, Optional} from '@angular/core'; +import {SessionCompanionIconsRegistry} from './session-companion-icons-registry.service'; +import { DOCUMENT } from '@angular/common'; @Component({ selector: 'app-sc-icons', @@ -8,13 +10,27 @@ import {ChangeDetectionStrategy, Component, ElementRef, Input} from '@angular/co styles: [':host::ng-deep svg{width: 50px; height: 50px}'], changeDetection: ChangeDetectionStrategy.OnPush }) -export class SessionCompanionIcons { +export class SessionCompanionIconsComponent { + + private svgIcon: SVGElement; @Input() set name(iconName: string) { - this.element.nativeElement.innerHTML = scIcons[iconName] || null; + if (this.svgIcon) { + this.element.nativeElement.removeChild(this.svgIcon); + } + const svgData = this.scIconRegistry.getIcon(iconName); + this.svgIcon = this.svgElementFromString(svgData); + this.element.nativeElement.appendChild(this.svgIcon); } - constructor(private element: ElementRef) { + constructor(private element: ElementRef, private scIconRegistry: SessionCompanionIconsRegistry, + @Optional() @Inject(DOCUMENT) private document: any) { + } + + private svgElementFromString(svgContent: string): SVGElement { + const div = this.document.createElement('DIV'); + div.innerHTML = svgContent; + return div.querySelector('svg') || this.document.createElementNS('http://www.w3.org/2000/svg', 'path'); } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts index b79dae7..eb9152a 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts @@ -4,7 +4,9 @@ import {SessionCompanionIconsComponent} from './session-companion-icons.componen @NgModule({ declarations: [SessionCompanionIconsComponent], imports: [], - exports: [] + exports: [ + SessionCompanionIconsComponent + ] }) export class SessionCompanionIconsModule { } From b82393a62bcb3a3558f02fb61b7cf15ce5572dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 16:33:02 +0100 Subject: [PATCH 04/26] SES-123 Lint errors fix --- .../components/registration/registration.component.html | 8 ++++---- .../src/app/components/sign-in/sign-in.component.html | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html index c9837d9..59ac6f3 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html @@ -11,7 +11,7 @@ type="text" required name="username"> - + Username is required person @@ -26,7 +26,7 @@ type="password" name="password"/> lock - + Password is required @@ -40,10 +40,10 @@ type="password" name="confirmPassword"/> lock - + Confirm your password - + Please make sure your passwords match diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html index 5b673af..4e5cc02 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html @@ -12,7 +12,7 @@ type="text" required name="username"> - + Username is required person @@ -28,7 +28,7 @@ type="password" name="password"/> lock - + Password is required From e17e3ace58357b188aec951273c6f627a7d8d78c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 17:55:28 +0100 Subject: [PATCH 05/26] SES-123 Added reducers and miissed unsubscribe --- .../SessionCompanion/ClientApp/src/app/app.module.ts | 4 ++-- .../src/app/components/sign-in/sign-in.component.ts | 10 +++++----- .../ClientApp/src/app/store/models/app-state.model.ts | 8 +++++++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index 74d137e..a61df94 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -23,9 +23,9 @@ import { import {UserService} from '../services/user.service'; import { StoreModule } from '@ngrx/store'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; -import {AppReducer} from './store/reducers/app.reducer'; import {environment} from '../environments/environment'; import {SessionCompanionIconsModule} from './shared/sc-icons/session-companion-icons.module'; +import {reducers} from './store/models/app-state.model'; @NgModule({ declarations: [ @@ -55,7 +55,7 @@ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), MatToolbarModule, MatListModule, SessionCompanionIconsModule, - StoreModule.forRoot({appState: AppReducer}), + StoreModule.forRoot(reducers), StoreDevtoolsModule.instrument({ logOnly: environment.production }) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts index d9c24be..9f2734b 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts @@ -6,9 +6,9 @@ import {ErrorResponse} from '../../../types/ErrorResponse'; import {Observable, Subscription} from 'rxjs'; import {HttpErrorResponse} from '@angular/common/http'; import {AppStoreModel} from '../../store/models/app-store.model'; -import { Store } from '@ngrx/store'; +import {select, Store} from '@ngrx/store'; import {AddUserId} from '../../store/actions/app.actions'; -import { AppState } from 'src/app/store/models/app-state.model'; +import {AppState} from 'src/app/store/models/app-state.model'; @Component({ selector: 'app-sign-in', @@ -38,14 +38,14 @@ export class SignInComponent implements OnDestroy, OnInit { }); ngOnInit() { - this.role$ = this.store.select(s => s.appState); + this.role$ = this.store.select(s => s.appStore); } onLoginButtonClick() { let role = ''; - this.store.select(s => s.appState.role).subscribe((v) => { + this.store.select(s => s.appStore.role).subscribe((v) => { role = v; - }); + }).unsubscribe(); this.allSubscriptions.add( this.userService.tryLogin( this.signInFormGroup.get('signIn').value['username'], diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts index 30226ba..8d87023 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts @@ -1,5 +1,11 @@ import {AppStoreModel} from './app-store.model'; +import {ActionReducerMap} from '@ngrx/store'; +import {AppReducer} from '../reducers/app.reducer'; export interface AppState { - appState: AppStoreModel; + appStore: AppStoreModel; } + +export const reducers: ActionReducerMap = { + appStore: AppReducer, +}; From 89c25d434255b49f6fb8b8514e1f09277d6570da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 19:47:13 +0100 Subject: [PATCH 06/26] SES-119 Added items tables --- .../ApplicationDbContext.cs | 6 +++ .../Repositories/ArmorRepository.cs | 15 +++++++ .../Repositories/CharacterArmorRepository.cs | 15 +++++++ .../CharacterOtherEquipmentRepository.cs | 15 +++++++ .../Repositories/CharacterWeaponRepository.cs | 14 +++++++ .../Repositories/OtherEquipmentRepository.cs | 15 +++++++ .../Repositories/WeaponRepository.cs | 14 +++++++ .../SessionCompanion.Database.csproj | 4 ++ .../SessionCompanion.Database/Tables/Armor.cs | 21 ++++++++++ .../Tables/CharacterArmor.cs | 18 +++++++++ .../Tables/CharacterOtherEquipment.cs | 15 +++++++ .../Tables/CharacterWeapon.cs | 20 ++++++++++ .../Tables/OtherEquipment.cs | 16 ++++++++ .../Tables/Weapon.cs | 29 ++++++++++++++ .../Intefraces/IArmorService.cs | 14 +++++++ .../Intefraces/ICharacterArmorService.cs | 16 ++++++++ .../ICharacterOtherEquipmentService.cs | 16 ++++++++ .../Intefraces/ICharacterWeaponService.cs | 10 +++++ .../Intefraces/IOtherEquipmentService.cs | 14 +++++++ .../Intefraces/IWeaponService.cs | 13 ++++++ .../Profiles/ArmorProfile.cs | 14 +++++++ .../Profiles/CharacterArmorsProfile.cs | 34 ++++++++++++++++ .../CharacterOtherEquipmentsProfile.cs | 31 ++++++++++++++ .../Profiles/CharacterWeaponsProfile.cs | 32 +++++++++++++++ .../Profiles/OtherEquipmentProfile.cs | 14 +++++++ .../Profiles/WeaponProfile.cs | 14 +++++++ .../Services/ArmorService.cs | 16 ++++++++ .../Services/CharacterArmorService.cs | 25 ++++++++++++ .../CharacterOtherEquipmentService.cs | 17 ++++++++ .../Services/CharacterWeaponService.cs | 15 +++++++ .../Services/OtherEquipmentService.cs | 20 ++++++++++ .../Services/WeaponService.cs | 18 +++++++++ .../ArmorViewModel/ArmorViewModel.cs | 18 +++++++++ .../CharacterArmorViewModel.cs | 14 +++++++ .../CharacterArmorViewModelDetails.cs | 21 ++++++++++ .../CharacterOtherEquipmentViewModel.cs | 13 ++++++ ...acterOtherEquipmentWithDetailsViewModel.cs | 15 +++++++ .../CharacterWeaponViewModel.cs | 17 ++++++++ ...racterWeaponWithWeaponsDetailsViewModel.cs | 28 +++++++++++++ .../Enums/CurrencyType.cs | 40 +++++++++++++++++++ .../OtherEquipmentViewModel.cs | 13 ++++++ .../SessionCompanion.ViewModels.xml | 30 ++++++++++++++ .../WeaponViewModels/WeaponViewModel.cs | 29 ++++++++++++++ .../Configurations/RepositoryConfiguration.cs | 6 +++ .../Configurations/ServiceConfiguration.cs | 7 ++++ 45 files changed, 801 insertions(+) create mode 100644 SessionCompanion/SessionCompanion.Database/Repositories/ArmorRepository.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Repositories/CharacterArmorRepository.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Repositories/CharacterOtherEquipmentRepository.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Repositories/CharacterWeaponRepository.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Repositories/OtherEquipmentRepository.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Repositories/WeaponRepository.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Tables/Armor.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Tables/CharacterArmor.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Tables/CharacterOtherEquipment.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Tables/CharacterWeapon.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Tables/OtherEquipment.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Tables/Weapon.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IArmorService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterArmorService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterOtherEquipmentService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterWeaponService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IOtherEquipmentService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Intefraces/IWeaponService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Profiles/ArmorProfile.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Profiles/CharacterArmorsProfile.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Profiles/CharacterOtherEquipmentsProfile.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Profiles/CharacterWeaponsProfile.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Profiles/OtherEquipmentProfile.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Profiles/WeaponProfile.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/ArmorService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/CharacterArmorService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/CharacterOtherEquipmentService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/CharacterWeaponService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/OtherEquipmentService.cs create mode 100644 SessionCompanion/SessionCompanion.Services/Services/WeaponService.cs create mode 100644 SessionCompanion/SessionCompanion.ViewModels/ArmorViewModel/ArmorViewModel.cs create mode 100644 SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModel.cs create mode 100644 SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModelDetails.cs create mode 100644 SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentViewModel.cs create mode 100644 SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentWithDetailsViewModel.cs create mode 100644 SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponViewModel.cs create mode 100644 SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponWithWeaponsDetailsViewModel.cs create mode 100644 SessionCompanion/SessionCompanion.ViewModels/Enums/CurrencyType.cs create mode 100644 SessionCompanion/SessionCompanion.ViewModels/OtherEquipmentViewModels/OtherEquipmentViewModel.cs create mode 100644 SessionCompanion/SessionCompanion.ViewModels/WeaponViewModels/WeaponViewModel.cs diff --git a/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs b/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs index 83ac5eb..11bf6e7 100644 --- a/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs +++ b/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs @@ -24,6 +24,12 @@ namespace SessionCompanion.Database public virtual DbSet Strengths { get; set; } public virtual DbSet Users { get; set; } public virtual DbSet Wisdoms { get; set; } + public virtual DbSet Armors { get; set; } + public virtual DbSet CharacterArmors { get; set; } + public virtual DbSet Weapons { get; set; } + public virtual DbSet CharacterWeapons { get; set; } + public virtual DbSet OtherEquipment { get; set; } + public virtual DbSet CharacterOtherEquipment { get; set; } public ApplicationDbContext(DbContextOptions options) : base(options) { } diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/ArmorRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/ArmorRepository.cs new file mode 100644 index 0000000..a4b187f --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/ArmorRepository.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + + public class ArmorRepository : Repository, IRepository + { + public ArmorRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/CharacterArmorRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterArmorRepository.cs new file mode 100644 index 0000000..e76b7d9 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterArmorRepository.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + + public class CharacterArmorRepository : Repository, IRepository + { + public CharacterArmorRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/CharacterOtherEquipmentRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterOtherEquipmentRepository.cs new file mode 100644 index 0000000..72b9546 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterOtherEquipmentRepository.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + + public class CharacterOtherEquipmentRepository : Repository, IRepository + { + public CharacterOtherEquipmentRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/CharacterWeaponRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterWeaponRepository.cs new file mode 100644 index 0000000..a5afaf2 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/CharacterWeaponRepository.cs @@ -0,0 +1,14 @@ +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + public class CharacterWeaponRepository: Repository, IRepository + { + public CharacterWeaponRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/OtherEquipmentRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/OtherEquipmentRepository.cs new file mode 100644 index 0000000..1da5898 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/OtherEquipmentRepository.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + + public class OtherEquipmentRepository : Repository, IRepository + { + public OtherEquipmentRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Repositories/WeaponRepository.cs b/SessionCompanion/SessionCompanion.Database/Repositories/WeaponRepository.cs new file mode 100644 index 0000000..6bd763d --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Repositories/WeaponRepository.cs @@ -0,0 +1,14 @@ +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Database.Repositories +{ + public class WeaponRepository : Repository, IRepository + { + public WeaponRepository(ApplicationDbContext _dbContext) : base(_dbContext) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj b/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj index e084383..a157829 100644 --- a/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj +++ b/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj @@ -17,4 +17,8 @@ + + + + diff --git a/SessionCompanion/SessionCompanion.Database/Tables/Armor.cs b/SessionCompanion/SessionCompanion.Database/Tables/Armor.cs new file mode 100644 index 0000000..ff5bf64 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/Armor.cs @@ -0,0 +1,21 @@ +using SessionCompanion.ViewModels.Enums; +using System.Collections.Generic; + +namespace SessionCompanion.Database.Tables +{ + + public class Armor : BaseEntity + { + public string Name { get; set; } + public string Category { get; set; } + public string ArmorClassBase {get; set; } + public bool HaveDexterityBonus { get; set; } + public int? MinimumStrength { get; set; } + public bool HaveStealthDisadvantage { get; set; } + public int Weight { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + + public virtual ICollection CharacterArmors { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Tables/CharacterArmor.cs b/SessionCompanion/SessionCompanion.Database/Tables/CharacterArmor.cs new file mode 100644 index 0000000..734c9c0 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/CharacterArmor.cs @@ -0,0 +1,18 @@ +namespace SessionCompanion.Database.Tables +{ + using System.ComponentModel.DataAnnotations.Schema; + + public class CharacterArmor : BaseEntity + { + [ForeignKey(nameof(Character))] + public int CharacterId { get; set; } + public virtual Character Character { get; set; } + + [ForeignKey(nameof(Armor))] + public int ArmorId { get; set; } + public virtual Armor Armor { get; set; } + + public bool InUse { get; set; } + + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Tables/CharacterOtherEquipment.cs b/SessionCompanion/SessionCompanion.Database/Tables/CharacterOtherEquipment.cs new file mode 100644 index 0000000..04c9e21 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/CharacterOtherEquipment.cs @@ -0,0 +1,15 @@ +namespace SessionCompanion.Database.Tables +{ + using System.ComponentModel.DataAnnotations.Schema; + + public class CharacterOtherEquipment : BaseEntity + { + [ForeignKey(nameof(Character))] + public int CharacterId { get; set; } + public virtual Character Character { get; set; } + + [ForeignKey(nameof(OtherEquipment))] + public int OtherEquipmentId { get; set; } + public virtual OtherEquipment OtherEquipment { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Tables/CharacterWeapon.cs b/SessionCompanion/SessionCompanion.Database/Tables/CharacterWeapon.cs new file mode 100644 index 0000000..93dec50 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/CharacterWeapon.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations.Schema; + +namespace SessionCompanion.Database.Tables +{ + public class CharacterWeapon : BaseEntity + { + [ForeignKey(nameof(Character))] + public int CharacterId { get; set; } + public virtual Character Character { get; set; } + + [ForeignKey(nameof(Weapon))] + public int WeaponId { get; set; } + public virtual Weapon Weapon { get; set; } + + public bool InUse { get; set; } + + public bool HoldInRightHand { get; set; } + public bool HoldInLeftHand { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Tables/OtherEquipment.cs b/SessionCompanion/SessionCompanion.Database/Tables/OtherEquipment.cs new file mode 100644 index 0000000..c03fbd1 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/OtherEquipment.cs @@ -0,0 +1,16 @@ +using SessionCompanion.ViewModels.Enums; +using System.Collections.Generic; + +namespace SessionCompanion.Database.Tables +{ + + public class OtherEquipment : BaseEntity + { + public string Name { get; set; } + public string Description { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + + public virtual ICollection CharacterOtherEquipments { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Tables/Weapon.cs b/SessionCompanion/SessionCompanion.Database/Tables/Weapon.cs new file mode 100644 index 0000000..9bc3d5f --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Tables/Weapon.cs @@ -0,0 +1,29 @@ +using SessionCompanion.ViewModels.Enums; +using System.Collections.Generic; + +namespace SessionCompanion.Database.Tables +{ + public class Weapon : BaseEntity + { + public string Name { get; set; } + public int Cost { get; set; } + public int Weight { get; set; } + + public CurrencyType CurrencyType { get; set; } + public int DiceCount { get; set; } + public int DiceValue { get; set; } + public int? TwoHandDiceCount { get; set; } + public int? TwoHandDiceValue { get; set; } + public string TwoHandDamageType { get; set; } + + public string Description { get; set; } + + public string WeaponType { get; set; } + public int RangeMeele { get; set; } + public int? RangeThrowNormal { get; set; } + public int? RangeThrowLong { get; set; } + public int? RangeLong { get; set; } + + public virtual ICollection CharacterWeapons { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IArmorService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IArmorService.cs new file mode 100644 index 0000000..4df8f73 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IArmorService.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.ViewModels.ArmorViewModels; + + public interface IArmorService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterArmorService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterArmorService.cs new file mode 100644 index 0000000..08f0382 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterArmorService.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + using System.Threading.Tasks; + + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.ViewModels.CharacterArmorViewModels; + + public interface ICharacterArmorService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterOtherEquipmentService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterOtherEquipmentService.cs new file mode 100644 index 0000000..ec20aca --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterOtherEquipmentService.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + using System.Threading.Tasks; + + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels; + + public interface ICharacterOtherEquipmentService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterWeaponService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterWeaponService.cs new file mode 100644 index 0000000..3ac386e --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/ICharacterWeaponService.cs @@ -0,0 +1,10 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.CharacterWeaponViewModels; + +namespace SessionCompanion.Services.Interfaces +{ + public interface ICharacterWeaponService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IOtherEquipmentService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IOtherEquipmentService.cs new file mode 100644 index 0000000..0f13254 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IOtherEquipmentService.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.ViewModels.OtherEquipmentViewModels; + + public interface IOtherEquipmentService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IWeaponService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IWeaponService.cs new file mode 100644 index 0000000..0c56409 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IWeaponService.cs @@ -0,0 +1,13 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.ViewModels.WeaponViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Interfaces +{ + public interface IWeaponService : IServiceBase + { + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/ArmorProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/ArmorProfile.cs new file mode 100644 index 0000000..598fb79 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/ArmorProfile.cs @@ -0,0 +1,14 @@ +using AutoMapper; +using SessionCompanion.Database.Tables; +using SessionCompanion.ViewModels.ArmorViewModels; + +namespace SessionCompanion.Services.Profiles +{ + public class ArmorProfile : Profile + { + public ArmorProfile() + { + CreateMap().ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterArmorsProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterArmorsProfile.cs new file mode 100644 index 0000000..a3ba8f0 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterArmorsProfile.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Profiles +{ + using AutoMapper; + + using SessionCompanion.Database.Tables; + using SessionCompanion.ViewModels.CharacterArmorViewModels; + + public class CharacterArmorsProfile : Profile + { + public CharacterArmorsProfile() + { + CreateMap().ReverseMap(); + + CreateMap() + .ForMember(vm => vm.Name, conf => conf.MapFrom(armor => armor.Armor.Name.ToString())) + .ForMember(vm => vm.Category, conf => conf.MapFrom(armor => armor.Armor.Category.ToString())) + .ForMember( + vm => vm.ArmorClassBase, + conf => conf.MapFrom(armor => armor.Armor.ArmorClassBase.ToString())) + .ForMember(vm => vm.HaveDexterityBonus, conf => conf.MapFrom(armor => armor.Armor.HaveDexterityBonus)) + .ForMember(vm => vm.MinimumStrength, conf => conf.MapFrom(armor => armor.Armor.MinimumStrength)) + .ForMember( + vm => vm.HaveStealthDisadvantage, + conf => conf.MapFrom(armor => armor.Armor.HaveStealthDisadvantage)) + .ForMember(vm => vm.Weight, conf => conf.MapFrom(armor => armor.Armor.Weight)) + .ForMember(vm => vm.Cost, conf => conf.MapFrom(armor => armor.Armor.Cost)) + .ForMember(vm => vm.CurrencyType, conf => conf.MapFrom(armor => armor.Armor.CurrencyType)).ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterOtherEquipmentsProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterOtherEquipmentsProfile.cs new file mode 100644 index 0000000..cafff93 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterOtherEquipmentsProfile.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Profiles +{ + using AutoMapper; + + using SessionCompanion.Database.Tables; + using SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels; + + public class CharacterOtherEquipmentsProfile : Profile + { + public CharacterOtherEquipmentsProfile() + { + CreateMap().ReverseMap(); + + CreateMap() + .ForMember(vm => vm.Name, conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.Name.ToString())) + .ForMember( + vm => vm.Description, + conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.Description.ToString())) + .ForMember( + vm => vm.Cost, + conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.Cost)) + .ForMember( + vm => vm.CurrencyType, + conf => conf.MapFrom(otherEquipment => otherEquipment.OtherEquipment.CurrencyType)).ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterWeaponsProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterWeaponsProfile.cs new file mode 100644 index 0000000..825c0aa --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterWeaponsProfile.cs @@ -0,0 +1,32 @@ +using AutoMapper; +using SessionCompanion.Database.Tables; +using SessionCompanion.ViewModels.CharacterWeaponViewModels; + +namespace SessionCompanion.Services.Profiles +{ + public class CharacterWeaponsProfile : Profile + { + public CharacterWeaponsProfile() + { + CreateMap().ReverseMap(); + + CreateMap() + .ForMember(vm => vm.Name, conf => conf.MapFrom(weapon => weapon.Weapon.Name.ToString())) + .ForMember(vm => vm.Weight, conf => conf.MapFrom(weapon => weapon.Weapon.Weight.ToString())) + .ForMember(vm => vm.HoldInRightHand, conf => conf.MapFrom(weapon => weapon.HoldInRightHand)) + .ForMember(vm => vm.HoldInLeftHand, conf => conf.MapFrom(weapon => weapon.HoldInLeftHand)) + .ForMember(vm => vm.Cost, conf => conf.MapFrom(weapon => weapon.Weapon.Cost.ToString())) + .ForMember(vm => vm.RangeMeele, conf => conf.MapFrom(weapon => weapon.Weapon.RangeMeele)) + .ForMember(vm => vm.RangeLong, conf => conf.MapFrom(weapon => weapon.Weapon.RangeLong)) + .ForMember(vm => vm.RangeThrowNormal, conf => conf.MapFrom(weapon => weapon.Weapon.RangeThrowNormal)) + .ForMember(vm => vm.RangeThrowLong, conf => conf.MapFrom(weapon => weapon.Weapon.RangeThrowLong)) + .ForMember(vm => vm.CurrencyType, conf => conf.MapFrom(weapon => weapon.Weapon.CurrencyType.ToString())) + .ForMember(vm => vm.WeaponType, conf => conf.MapFrom(weapon => weapon.Weapon.WeaponType.ToString())) + .ForMember(vm => vm.Description, conf => conf.MapFrom(weapon => weapon.Weapon.Description)) + .ForMember(vm => vm.DiceValue, conf => conf.MapFrom(weapon => weapon.Weapon.DiceValue)) + .ForMember(vm => vm.DiceCount, conf => conf.MapFrom(weapon => weapon.Weapon.DiceCount)) + .ForMember(vm => vm.TwoHandDiceValue, conf => conf.MapFrom(weapon => weapon.Weapon.TwoHandDiceValue)) + .ForMember(vm => vm.TwoHandDamageType, conf => conf.MapFrom(weapon => weapon.Weapon.TwoHandDamageType.ToString())).ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/OtherEquipmentProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/OtherEquipmentProfile.cs new file mode 100644 index 0000000..529e6ea --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/OtherEquipmentProfile.cs @@ -0,0 +1,14 @@ +using AutoMapper; +using SessionCompanion.Database.Tables; +using SessionCompanion.ViewModels.OtherEquipmentViewModels; + +namespace SessionCompanion.Services.Profiles +{ + public class OtherEquipmentProfile : Profile + { + public OtherEquipmentProfile() + { + CreateMap().ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/WeaponProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/WeaponProfile.cs new file mode 100644 index 0000000..a0a6c69 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Profiles/WeaponProfile.cs @@ -0,0 +1,14 @@ +using AutoMapper; +using SessionCompanion.Database.Tables; +using SessionCompanion.ViewModels.WeaponViewModels; + +namespace SessionCompanion.Services.Profiles +{ + public class WeaponProfile : Profile + { + public WeaponProfile() + { + CreateMap().ReverseMap(); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/ArmorService.cs b/SessionCompanion/SessionCompanion.Services/Services/ArmorService.cs new file mode 100644 index 0000000..9397f8c --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/ArmorService.cs @@ -0,0 +1,16 @@ +namespace SessionCompanion.Services.Services +{ + using AutoMapper; + + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.Services.Interfaces; + using SessionCompanion.ViewModels.ArmorViewModels; + + public class ArmorService : ServiceBase, IArmorService + { + public ArmorService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharacterArmorService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharacterArmorService.cs new file mode 100644 index 0000000..8b417dd --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/CharacterArmorService.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + using System.Linq; + using System.Threading.Tasks; + + using AutoMapper; + + using Microsoft.EntityFrameworkCore; + + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.Services.Interfaces; + using SessionCompanion.ViewModels.CharacterArmorViewModels; + + public class CharacterArmorService : ServiceBase, ICharacterArmorService + { + public CharacterArmorService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharacterOtherEquipmentService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharacterOtherEquipmentService.cs new file mode 100644 index 0000000..1d80427 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/CharacterOtherEquipmentService.cs @@ -0,0 +1,17 @@ +namespace SessionCompanion.Services.Services +{ + + using AutoMapper; + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.Services.Interfaces; + using SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels; + + public class CharacterOtherEquipmentService : ServiceBase, ICharacterOtherEquipmentService + { + public CharacterOtherEquipmentService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharacterWeaponService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharacterWeaponService.cs new file mode 100644 index 0000000..3dae1ac --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/CharacterWeaponService.cs @@ -0,0 +1,15 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.CharacterWeaponViewModels; + +namespace SessionCompanion.Services.Services +{ + public class CharacterWeaponService : ServiceBase, ICharacterWeaponService + { + public CharacterWeaponService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/OtherEquipmentService.cs b/SessionCompanion/SessionCompanion.Services/Services/OtherEquipmentService.cs new file mode 100644 index 0000000..c10e425 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/OtherEquipmentService.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + using AutoMapper; + + using SessionCompanion.Database.Repositories.Base; + using SessionCompanion.Database.Tables; + using SessionCompanion.Services.Base; + using SessionCompanion.Services.Interfaces; + using SessionCompanion.ViewModels.OtherEquipmentViewModels; + + public class OtherEquipmentService : ServiceBase, IOtherEquipmentService + { + public OtherEquipmentService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.Services/Services/WeaponService.cs b/SessionCompanion/SessionCompanion.Services/Services/WeaponService.cs new file mode 100644 index 0000000..a3a12f4 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Services/Services/WeaponService.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using SessionCompanion.Database.Repositories.Base; +using SessionCompanion.Database.Tables; +using SessionCompanion.Services.Base; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.WeaponViewModels; +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.Services.Services +{ + public class WeaponService : ServiceBase, IWeaponService + { + public WeaponService(IMapper mapper, IRepository repository) : base(mapper, repository) + { } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/ArmorViewModel/ArmorViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/ArmorViewModel/ArmorViewModel.cs new file mode 100644 index 0000000..892da7c --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/ArmorViewModel/ArmorViewModel.cs @@ -0,0 +1,18 @@ +namespace SessionCompanion.ViewModels.ArmorViewModels +{ + using SessionCompanion.ViewModels.Enums; + + public class ArmorViewModel + { + public int Id { get; set; } + public string Name { get; set; } + public string Category { get; set; } + public string ArmorClassBase { get; set; } + public bool HaveDexterityBonus { get; set; } + public int? MinimumStrength { get; set; } + public bool HaveStealthDisadvantage { get; set; } + public int Weight { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModel.cs new file mode 100644 index 0000000..a8098de --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.ViewModels.CharacterArmorViewModels +{ + public class CharacterArmorViewModel + { + public int Id { get; set; } + public int CharacterId { get; set; } + public int ArmorId { get; set; } + public bool InUse { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModelDetails.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModelDetails.cs new file mode 100644 index 0000000..57bb3fc --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterArmorViewModels/CharacterArmorViewModelDetails.cs @@ -0,0 +1,21 @@ +using SessionCompanion.ViewModels.Enums; + +namespace SessionCompanion.ViewModels.CharacterArmorViewModels +{ + public class CharacterArmorViewModelDetails + { + public int Id { get; set; } + public int CharacterId { get; set; } + public int ArmorId { get; set; } + public string Name { get; set; } + public string Category { get; set; } + public string ArmorClassBase { get; set; } + public bool HaveDexterityBonus { get; set; } + public int? MinimumStrength { get; set; } + public bool HaveStealthDisadvantage { get; set; } + public int Weight { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + public bool InUse { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentViewModel.cs new file mode 100644 index 0000000..7317779 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentViewModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels +{ + public class CharacterOtherEquipmentViewModel + { + public int Id { get; set; } + public int CharacterId { get; set; } + public int OtherEquipmentId { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentWithDetailsViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentWithDetailsViewModel.cs new file mode 100644 index 0000000..9e08e80 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterOtherEquipmentViewModels/CharacterOtherEquipmentWithDetailsViewModel.cs @@ -0,0 +1,15 @@ +using SessionCompanion.ViewModels.Enums; + +namespace SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels +{ + public class CharacterOtherEquipmentWithDetailsViewModel + { + public int Id { get; set; } + public int CharacterId { get; set; } + public int OtherEquipmentId { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponViewModel.cs new file mode 100644 index 0000000..50fd0d7 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Text; + +namespace SessionCompanion.ViewModels.CharacterWeaponViewModels +{ + public class CharacterWeaponViewModel + { + public int Id { get; set; } + public int CharacterId { get; set; } + public int WeaponId { get; set; } + public bool InUse { get; set; } + public bool HoldInRightHand { get; set; } + public bool HoldInLeftHand { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponWithWeaponsDetailsViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponWithWeaponsDetailsViewModel.cs new file mode 100644 index 0000000..2e42d82 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterWeaponsViewModels/CharacterWeaponWithWeaponsDetailsViewModel.cs @@ -0,0 +1,28 @@ +using SessionCompanion.ViewModels.Enums; +using System.Collections.Generic; + +namespace SessionCompanion.ViewModels.CharacterWeaponViewModels +{ + public class CharacterWeaponWithWeaponDetailsViewModel + { + public int WeaponId { get; set; } + public bool InUse { get; set; } + public string Name { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + public int Weight { get; set; } + public bool HoldInRightHand { get; set; } + public bool HoldInLeftHand { get; set; } + public int DiceCount { get; set; } + public int DiceValue { get; set; } + public int? TwoHandDiceCount { get; set; } + public int? TwoHandDiceValue { get; set; } + public string TwoHandDamageType { get; set; } + public string Description { get; set; } + public string WeaponType { get; set; } + public int RangeMeele { get; set; } + public int? RangeThrowNormal { get; set; } + public int? RangeThrowLong { get; set; } + public int? RangeLong { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/Enums/CurrencyType.cs b/SessionCompanion/SessionCompanion.ViewModels/Enums/CurrencyType.cs new file mode 100644 index 0000000..3777e97 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/Enums/CurrencyType.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.ViewModels.Enums +{ + + /// + /// Rodzaje waluty + /// + public enum CurrencyType + { + /// + /// Bronz + /// + cp, + + /// + /// Srebro + /// + sp, + + /// + /// Elektrum + /// + ep, + + /// + /// Złotot + /// + gp, + + /// + /// Platyna + /// + pp + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/OtherEquipmentViewModels/OtherEquipmentViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/OtherEquipmentViewModels/OtherEquipmentViewModel.cs new file mode 100644 index 0000000..3774892 --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/OtherEquipmentViewModels/OtherEquipmentViewModel.cs @@ -0,0 +1,13 @@ +namespace SessionCompanion.ViewModels.OtherEquipmentViewModels +{ + using SessionCompanion.ViewModels.Enums; + + public class OtherEquipmentViewModel + { + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public int Cost { get; set; } + public CurrencyType CurrencyType { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml index 71e048b..0f4d1b1 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml +++ b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml @@ -305,6 +305,36 @@ Czy postać posiada biegłość w skradaniu się + + + Rodzaje waluty + + + + + Bronz + + + + + Srebro + + + + + Elektrum + + + + + Złotot + + + + + Platyna + + Identyfikator inteligencji postaci diff --git a/SessionCompanion/SessionCompanion.ViewModels/WeaponViewModels/WeaponViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/WeaponViewModels/WeaponViewModel.cs new file mode 100644 index 0000000..4281d7e --- /dev/null +++ b/SessionCompanion/SessionCompanion.ViewModels/WeaponViewModels/WeaponViewModel.cs @@ -0,0 +1,29 @@ +using SessionCompanion.ViewModels.Enums; +using System.Collections.Generic; + +namespace SessionCompanion.ViewModels.WeaponViewModels +{ + public class WeaponViewModel + { + public int Id { get; set; } + public string Name { get; set; } + public int Cost { get; set; } + public int Weight { get; set; } + + public CurrencyType CurrencyType { get; set; } + public int DiceCount { get; set; } + public int DiceValue { get; set; } + + public int? TwoHandDiceCount { get; set; } + public int? TwoHandDiceValue { get; set; } + public string TwoHandDamageType { get; set; } + + public string Description { get; set; } + + public string WeaponType { get; set; } + public int RangeMeele { get; set; } + public int? RangeThrowNormal { get; set; } + public int? RangeThrowLong { get; set; } + public int? RangeLong { get; set; } + } +} diff --git a/SessionCompanion/SessionCompanion/Configurations/RepositoryConfiguration.cs b/SessionCompanion/SessionCompanion/Configurations/RepositoryConfiguration.cs index 888dce3..fdbcfd1 100644 --- a/SessionCompanion/SessionCompanion/Configurations/RepositoryConfiguration.cs +++ b/SessionCompanion/SessionCompanion/Configurations/RepositoryConfiguration.cs @@ -27,6 +27,12 @@ namespace SessionCompanion.Configurations services.AddScoped, StrengthRepository>(); services.AddScoped, UserRepository>(); services.AddScoped, WisdomRepository>(); + services.AddScoped, ArmorRepository>(); + services.AddScoped, CharacterArmorRepository>(); + services.AddScoped, OtherEquipmentRepository>(); + services.AddScoped, CharacterOtherEquipmentRepository>(); + services.AddScoped, WeaponRepository>(); + services.AddScoped, CharacterWeaponRepository>(); return services; } diff --git a/SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs b/SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs index 0d29b5d..c243a8f 100644 --- a/SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs +++ b/SessionCompanion/SessionCompanion/Configurations/ServiceConfiguration.cs @@ -26,6 +26,13 @@ namespace SessionCompanion.Configurations services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + return services; } } From fe5921fa578662f8a0d1f2db6950d30c9dab0a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 21:17:00 +0100 Subject: [PATCH 07/26] SES-116 Small fix on backend --- .../SessionCompanion.Services/Profiles/CharacterProfile.cs | 3 ++- .../SessionCompanion.Services/Services/CharacterService.cs | 1 + .../CharacterViewModels/CharacterBasicStatsViewModel.cs | 5 +++++ .../SessionCompanion.ViewModels.xml | 5 +++++ .../SessionCompanion/Controllers/CharacterController.cs | 3 +++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs index 7f1417b..0262a5f 100644 --- a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs +++ b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs @@ -23,7 +23,8 @@ namespace SessionCompanion.Services.Profiles CreateMap() .ForMember(vm => vm.Name, conf => conf.MapFrom(charact => charact.Biography.Name)) .ForMember(vm => vm.Level, conf => conf.MapFrom(charact => charact.Statistics.Level)) - .ForMember(vm => vm.CurrentHealthPoints, conf => conf.MapFrom(charact => charact.Statistics.CurrentHealthPoints)).ReverseMap(); + .ForMember(vm => vm.CurrentHealthPoints, conf => conf.MapFrom(charact => charact.Statistics.CurrentHealthPoints)) + .ForMember(vm => vm.Class, conf => conf.MapFrom(charact => charact.Biography.Class.Name)).ReverseMap(); } } } diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs index a336d42..a07f53c 100644 --- a/SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs +++ b/SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs @@ -46,6 +46,7 @@ namespace SessionCompanion.Services.Services { var characters = await Repository.Get(c => charactersId.Contains(c.Id)) .Include(x => x.Biography) + .ThenInclude(x => x.Class) .Include(x => x.Statistics).ToListAsync(); var result = Mapper.Map>(characters); return result; diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs index 525419f..adbfafd 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs @@ -21,5 +21,10 @@ /// Aktualna ilość życia postaci /// public int CurrentHealthPoints { get; set; } + + /// + /// Klasa postaci + /// + public string Class { get; set; } } } diff --git a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml index 71e048b..20c6929 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml +++ b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml @@ -100,6 +100,11 @@ Aktualna ilość życia postaci + + + Klasa postaci + + Identyfikator postaci diff --git a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs index d35eb6f..1545fc1 100644 --- a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs +++ b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs @@ -72,6 +72,9 @@ namespace SessionCompanion.Controllers public async Task, ErrorResponse>> GetLoggedUsersCharacters() { var connectedCharacters = _sessionHubData.ConnectedCharacters_Prop; + connectedCharacters.Add("a", 1); + connectedCharacters.Add("s", 2); + connectedCharacters.Add("d", 3); var characters = await _service.GetBasicCharactersData(connectedCharacters.Values.ToList()); return characters.ToList(); From 2a5e04bbd1867046ca16755d76129069bf88b5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 21:17:19 +0100 Subject: [PATCH 08/26] SES-116 Get lsit of logged characters --- .../ClientApp/src/app/app.module.ts | 4 +- .../game-master-dashboard.component.ts | 39 +++++++++++++++++-- .../signalR-service/gm-signalR.service.ts | 12 +++++- .../src/services/character.service.ts | 29 ++++++++++++++ .../LoggedCharactersViewModel.ts | 6 +++ 5 files changed, 84 insertions(+), 6 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index 6bed2fc..0088ea4 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -26,6 +26,7 @@ import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import { reducers} from './reducers'; import {AppReducer} from './store/reducers/app.reducer'; import {environment} from '../environments/environment'; +import {CharacterService} from '../services/character.service'; @NgModule({ declarations: [ @@ -60,7 +61,8 @@ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), }) ], providers: [ - UserService + UserService, + CharacterService ], bootstrap: [AppComponent] }) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts index 1b303b8..2739bdb 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts @@ -1,6 +1,10 @@ -import {Component, OnInit} from '@angular/core'; +import {Component, OnDestroy, OnInit} from '@angular/core'; import {animateText, onSideNavChange} from '../../shared/animations/sidenav-animations'; import {GMSignalRService} from '../../shared/signalR-service/gm-signalR.service'; +import {CharacterService} from '../../../services/character.service'; +import {Subscription} from 'rxjs'; +import {ErrorResponse} from '../../../types/ErrorResponse'; +import {HttpErrorResponse} from '@angular/common/http'; @Component({ selector: 'app-game-master-dashboard', @@ -8,13 +12,16 @@ import {GMSignalRService} from '../../shared/signalR-service/gm-signalR.service' styleUrls: ['./game-master-dashboard.component.css'], animations: [onSideNavChange, animateText] }) -export class GameMasterDashboardComponent implements OnInit { +export class GameMasterDashboardComponent implements OnInit, OnDestroy { + allSubscriptions = new Subscription(); leftSidenavExpanded = false; leftSidenavTextExpanded = false; rightSidenavExpanded = false; rightSidenavTextExpanded = false; - constructor(private signalRService: GMSignalRService) {} + constructor(private signalRService: GMSignalRService, private characterService: CharacterService) { + this.SubscribeToEvents(); + } ngOnInit() { this.signalRService.Login(); @@ -36,4 +43,30 @@ export class GameMasterDashboardComponent implements OnInit { break; } } + + UpdateCharactersList(): void { + this.allSubscriptions.add( + this.characterService.getLoggedCharacters().subscribe((success) => { + console.log(success); + }, + (error: ErrorResponse | HttpErrorResponse) => { + if (error instanceof HttpErrorResponse) { + error = error.error as ErrorResponse; + } + console.error(error.message); + })); + } + + private SubscribeToEvents(): void { + debugger + this.signalRService.message.subscribe((message: string) => { + if (message === 'New player connected' || message === 'Player disconnected') { + this.UpdateCharactersList(); + } + }); + } + + ngOnDestroy() { + this.allSubscriptions.unsubscribe(); + } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/signalR-service/gm-signalR.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/signalR-service/gm-signalR.service.ts index 4ca94db..08cf425 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/signalR-service/gm-signalR.service.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/signalR-service/gm-signalR.service.ts @@ -1,12 +1,15 @@ import { Inject, Injectable } from '@angular/core'; import { SignalRService } from './base/signalR.service'; +import {Subject} from 'rxjs'; @Injectable({ providedIn: 'root' }) export class GMSignalRService { signalR: SignalRService; + message: Subject; constructor(@Inject('BASE_URL') baseUrl: string) { this.signalR = new SignalRService(baseUrl); + this.message = new Subject(); this.registerOnServerEvents(); } @@ -17,10 +20,15 @@ export class GMSignalRService { if (this.signalR.connectionEstablished$.getValue() === true) { this.signalR.hubConnection.send('GameMasterLogin'); } - }); + }).unsubscribe(); } private registerOnServerEvents(): void { - + this.signalR.hubConnection.on('Welcome', (message: string) => { + this.message.next('New player connected'); + }); + this.signalR.hubConnection.on('GoodBye', (message: string) => { + this.message.next('Player disconnected'); + }); } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts new file mode 100644 index 0000000..b166270 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts @@ -0,0 +1,29 @@ +import {Inject, Injectable} from '@angular/core'; +import {HttpClient} from '@angular/common/http'; +import {Observable, of, throwError} from 'rxjs'; +import {ErrorResponse} from '../types/ErrorResponse'; +import {Either} from '../types/Either'; +import {switchMap} from 'rxjs/operators'; +import {LoggedCharactersViewModel} from '../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; + +Injectable({ + providedIn: 'root' +}) +export class CharacterService { + private baseUrl = 'api/character/'; + constructor(private http: HttpClient, @Inject('BASE_URL') baseUrl: string) { + this.baseUrl = baseUrl + this.baseUrl; + } + + getLoggedCharacters(): Observable { + return this.http.get>(this.baseUrl + 'loggedCharacters').pipe( + switchMap(response => { + if (response.isLeft) { + return of(response.left); + } else { + return throwError(response.right); + } + }) + ); + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts new file mode 100644 index 0000000..c61a496 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts @@ -0,0 +1,6 @@ +export interface LoggedCharactersViewModel { + id: number; + name: string; + level: number; + currentHealthPoints: number; +} From d61c3f620fd0e63a5818215fbb767bcbba1e4fc3 Mon Sep 17 00:00:00 2001 From: Natalia Gawron Date: Mon, 28 Dec 2020 13:38:45 +0100 Subject: [PATCH 09/26] added pointer class, updated mockup character list --- .../registration/registration.component.html | 2 +- .../select-character.component.css | 4 -- .../select-character.component.html | 24 +++----- .../select-character.component.ts | 55 ++++++++++++++++++- .../components/sign-in/sign-in.component.html | 2 +- .../SessionCompanion/ClientApp/src/styles.css | 4 ++ 6 files changed, 69 insertions(+), 22 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html index 59ac6f3..9f07043 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/registration/registration.component.html @@ -1,6 +1,6 @@
- arrow_back + arrow_back
Create an Account
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.css index ccf116c..41aa481 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.css @@ -47,10 +47,6 @@ input { font-size: 20px; } -.align-to-right { - text-align: right; -} - @media (max-width: 400px) { .container { margin-left: 0%; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html index 178319d..fb89f12 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html @@ -1,21 +1,15 @@
- arrow_back + arrow_back
Select character
- + - Oweja - arrow_forward + + account_circle +
{{character.name}}
+ arrow_forward +
{{character.className}} level: {{character.level}}
+
- - James - arrow_forward - - - Legolas - arrow_forward - - -
- +
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts index 2409f57..6360982 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts @@ -1,12 +1,66 @@ import { Component } from '@angular/core'; import { Router } from '@angular/router'; +export interface Section { + name: string; + className: string; + level: number; +} + @Component({ selector: 'app-select-character', templateUrl: './select-character.component.html', styleUrls: ['./select-character.component.css'] }) export class SelectCharacterComponent { + characters: Section[] = [ + { + name: 'Oweja', + className: 'warrior', + level: 1, + }, + { + name: 'James', + className: 'warrior', + level: 2, + }, + { + name: 'Legolas', + className: 'warrior', + level: 3, + }, + { + name: 'Oweja', + className: 'warrior', + level: 1, + }, + { + name: 'James', + className: 'warrior', + level: 2, + }, + { + name: 'Legolas', + className: 'warrior', + level: 3, + }, + { + name: 'Oweja', + className: 'warrior', + level: 1, + }, + { + name: 'James', + className: 'warrior', + level: 2, + }, + { + name: 'Legolas', + className: 'warrior', + level: 3, + } + ]; + isExpanded = false; collapse() { @@ -27,4 +81,3 @@ export class SelectCharacterComponent { this.router.navigate(['login']) } } - diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html index 4e5cc02..6eede7b 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.html @@ -1,6 +1,6 @@
- arrow_back + arrow_back
Sign In
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/styles.css b/SessionCompanion/SessionCompanion/ClientApp/src/styles.css index bd973fd..311e04a 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/styles.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/styles.css @@ -73,6 +73,10 @@ mat-divider { border-top-color: #e9cca7 !important; } +.arrow-select { + cursor: pointer; +} + html, body { height: 100%; From 7b430e05cbb25ca5ecb8bf4795daf656a88b8fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Mon, 28 Dec 2020 14:59:42 +0100 Subject: [PATCH 10/26] SES-116 Database update and icons fix --- .../20201228114303_Class name fix.Designer.cs | 838 ++++++++++++++++++ .../20201228114303_Class name fix.cs | 55 ++ .../ApplicationDbContextModelSnapshot.cs | 6 +- .../SessionCompanion.Database/SeedData.cs | 6 +- .../ClientApp/src/app/app.component.ts | 12 +- .../ClientApp/src/app/app.module.ts | 2 - .../game-master-dashboard.component.html | 14 +- .../game-master-dashboard.component.ts | 18 +- ...ession-companion-icons-registry.service.ts | 30 +- .../session-companion-icons.component.ts | 36 - .../session-companion-icons.module.ts | 12 - .../src/services/character.service.ts | 5 +- .../LoggedCharactersViewModel.ts | 1 + .../Controllers/CharacterController.cs | 9 +- 14 files changed, 942 insertions(+), 102 deletions(-) create mode 100644 SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.Designer.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.cs delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts diff --git a/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.Designer.cs b/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.Designer.cs new file mode 100644 index 0000000..7bbd955 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.Designer.cs @@ -0,0 +1,838 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SessionCompanion.Database; + +namespace SessionCompanion.Database.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20201228114303_Class name fix")] + partial class Classnamefix + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseIdentityColumns() + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.0"); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Alignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.HasKey("Id"); + + b.ToTable("Alignments"); + + b.HasData( + new + { + Id = 1 + }, + new + { + Id = 2 + }, + new + { + Id = 3 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Background", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.HasKey("Id"); + + b.ToTable("Backgrounds"); + + b.HasData( + new + { + Id = 1 + }, + new + { + Id = 2 + }, + new + { + Id = 3 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Biography", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("AlignmentId") + .HasColumnType("int"); + + b.Property("BackgroundId") + .HasColumnType("int"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("ClassId") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("RaceId") + .HasColumnType("int"); + + b.Property("Sex") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("AlignmentId"); + + b.HasIndex("BackgroundId"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.HasIndex("ClassId"); + + b.HasIndex("RaceId"); + + b.ToTable("Biographies"); + + b.HasData( + new + { + Id = 1, + AlignmentId = 1, + BackgroundId = 1, + CharacterId = 1, + ClassId = 1, + Name = "Bob", + RaceId = 1, + Sex = "Male" + }, + new + { + Id = 2, + AlignmentId = 2, + BackgroundId = 2, + CharacterId = 2, + ClassId = 2, + Name = "Queen Daenerys Stormborn of the House Targaryen, the First of Her Name, Queen of the Andals, the Rhoynar and the First Men, Lady of the Seven Kingdoms and Protector of the Realm, Lady of Dragonstone, Queen of Meereen, Khaleesi of the Great Grass Sea, the Unburnt, Breaker of Chains and Mother of Dragons.", + RaceId = 2, + Sex = "Female" + }, + new + { + Id = 3, + AlignmentId = 3, + BackgroundId = 3, + CharacterId = 3, + ClassId = 3, + Name = "Gandalf the White", + RaceId = 3, + Sex = "Both" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Characters"); + + b.HasData( + new + { + Id = 1, + UserId = 1 + }, + new + { + Id = 2, + UserId = 2 + }, + new + { + Id = 3, + UserId = 3 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Charisma", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("CanDeception") + .HasColumnType("bit"); + + b.Property("CanIntimidation") + .HasColumnType("bit"); + + b.Property("CanPerformance") + .HasColumnType("bit"); + + b.Property("CanPersuasion") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Deception") + .HasColumnType("int"); + + b.Property("Intimidation") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("Performance") + .HasColumnType("int"); + + b.Property("Persuasion") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Charismas"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Class", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Classes"); + + b.HasData( + new + { + Id = 1, + Name = "Fighter" + }, + new + { + Id = 2, + Name = "Paladin" + }, + new + { + Id = 3, + Name = "Cleric" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Constitution", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Constitutions"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Dexterity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Acrobatics") + .HasColumnType("int"); + + b.Property("CanAcrobatics") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CanSleightOfHand") + .HasColumnType("bit"); + + b.Property("CanStealth") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("SleightOfHand") + .HasColumnType("int"); + + b.Property("Stealth") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Dexterities"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Intelligence", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Arcana") + .HasColumnType("int"); + + b.Property("CanArcana") + .HasColumnType("bit"); + + b.Property("CanHistory") + .HasColumnType("bit"); + + b.Property("CanInvestigation") + .HasColumnType("bit"); + + b.Property("CanNature") + .HasColumnType("bit"); + + b.Property("CanReligion") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("History") + .HasColumnType("int"); + + b.Property("Investigation") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("Nature") + .HasColumnType("int"); + + b.Property("Religion") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Intelligences"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Race", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Races"); + + b.HasData( + new + { + Id = 1, + Name = "Human" + }, + new + { + Id = 2, + Name = "Dwarf" + }, + new + { + Id = 3, + Name = "Elf" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Statistics", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("ArmorClass") + .HasColumnType("int"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("CurrentHealthPoints") + .HasColumnType("int"); + + b.Property("ExperiencePoints") + .HasColumnType("int"); + + b.Property("HealthPoints") + .HasColumnType("int"); + + b.Property("Initiative") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Proficiency") + .HasColumnType("int"); + + b.Property("Speed") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Statistics"); + + b.HasData( + new + { + Id = 1, + ArmorClass = 9, + CharacterId = 1, + CurrentHealthPoints = 18, + ExperiencePoints = 2, + HealthPoints = 20, + Initiative = 12, + Level = 1, + Proficiency = 1, + Speed = 5 + }, + new + { + Id = 2, + ArmorClass = 12, + CharacterId = 2, + CurrentHealthPoints = 26, + ExperiencePoints = 0, + HealthPoints = 26, + Initiative = 7, + Level = 1, + Proficiency = 1, + Speed = 10 + }, + new + { + Id = 3, + ArmorClass = 2, + CharacterId = 3, + CurrentHealthPoints = 7, + ExperiencePoints = 24, + HealthPoints = 7, + Initiative = 18, + Level = 1, + Proficiency = 2, + Speed = 15 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Strength", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Athletics") + .HasColumnType("int"); + + b.Property("CanAthletics") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Strengths"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Password") + .HasColumnType("nvarchar(max)"); + + b.Property("Username") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Users"); + + b.HasData( + new + { + Id = 1, + Password = "123", + Username = "Morwiec" + }, + new + { + Id = 2, + Password = "123", + Username = "Cichoklepiec" + }, + new + { + Id = 3, + Password = "123", + Username = "Ruletka" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Wisdom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("AnimalHandling") + .HasColumnType("int"); + + b.Property("CanAnimalHandling") + .HasColumnType("bit"); + + b.Property("CanInsight") + .HasColumnType("bit"); + + b.Property("CanMedicine") + .HasColumnType("bit"); + + b.Property("CanPerception") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CanSurvival") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Insight") + .HasColumnType("int"); + + b.Property("Medicine") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("Perception") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Survival") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Wisdoms"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Biography", b => + { + b.HasOne("SessionCompanion.Database.Tables.Alignment", "Alignment") + .WithMany("Biography") + .HasForeignKey("AlignmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Background", "Background") + .WithMany("Biography") + .HasForeignKey("BackgroundId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Biography") + .HasForeignKey("SessionCompanion.Database.Tables.Biography", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Class", "Class") + .WithMany("Biography") + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Race", "Race") + .WithMany("Biography") + .HasForeignKey("RaceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alignment"); + + b.Navigation("Background"); + + b.Navigation("Character"); + + b.Navigation("Class"); + + b.Navigation("Race"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b => + { + b.HasOne("SessionCompanion.Database.Tables.User", "User") + .WithMany("Character") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Charisma", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Charisma") + .HasForeignKey("SessionCompanion.Database.Tables.Charisma", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Constitution", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Constitution") + .HasForeignKey("SessionCompanion.Database.Tables.Constitution", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Dexterity", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Dexterity") + .HasForeignKey("SessionCompanion.Database.Tables.Dexterity", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Intelligence", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Intelligence") + .HasForeignKey("SessionCompanion.Database.Tables.Intelligence", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Statistics", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Statistics") + .HasForeignKey("SessionCompanion.Database.Tables.Statistics", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Strength", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Strength") + .HasForeignKey("SessionCompanion.Database.Tables.Strength", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Wisdom", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Wisdom") + .HasForeignKey("SessionCompanion.Database.Tables.Wisdom", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Alignment", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Background", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b => + { + b.Navigation("Biography"); + + b.Navigation("Charisma"); + + b.Navigation("Constitution"); + + b.Navigation("Dexterity"); + + b.Navigation("Intelligence"); + + b.Navigation("Statistics"); + + b.Navigation("Strength"); + + b.Navigation("Wisdom"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Class", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Race", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.User", b => + { + b.Navigation("Character"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.cs b/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.cs new file mode 100644 index 0000000..c0633fa --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.cs @@ -0,0 +1,55 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace SessionCompanion.Database.Migrations +{ + public partial class Classnamefix : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 1, + column: "Name", + value: "Fighter"); + + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 2, + column: "Name", + value: "Paladin"); + + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 3, + column: "Name", + value: "Cleric"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 1, + column: "Name", + value: "Warrior"); + + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 2, + column: "Name", + value: "Knight"); + + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 3, + column: "Name", + value: "Priest"); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs b/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs index 7898310..e4915a1 100644 --- a/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs @@ -255,17 +255,17 @@ namespace SessionCompanion.Database.Migrations new { Id = 1, - Name = "Warrior" + Name = "Fighter" }, new { Id = 2, - Name = "Knight" + Name = "Paladin" }, new { Id = 3, - Name = "Priest" + Name = "Cleric" }); }); diff --git a/SessionCompanion/SessionCompanion.Database/SeedData.cs b/SessionCompanion/SessionCompanion.Database/SeedData.cs index 81a9f5e..38fda48 100644 --- a/SessionCompanion/SessionCompanion.Database/SeedData.cs +++ b/SessionCompanion/SessionCompanion.Database/SeedData.cs @@ -66,17 +66,17 @@ namespace SessionCompanion.Database new Class { Id = 1, - Name = "Warrior" + Name = "Fighter" }, new Class { Id = 2, - Name = "Knight" + Name = "Paladin" }, new Class { Id = 3, - Name = "Priest" + Name = "Cleric" } }; return classes; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.component.ts index b7b309e..96d886d 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.component.ts @@ -1,9 +1,17 @@ -import { Component } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; +import {SessionCompanionIconsRegistry} from './shared/sc-icons/session-companion-icons-registry.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) -export class AppComponent { +export class AppComponent implements OnInit{ title = 'Session Companion'; + + constructor(private iconService: SessionCompanionIconsRegistry) { + } + + ngOnInit() { + this.iconService.registerIcons(); + } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index 66c1ab2..29d4a9b 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -24,7 +24,6 @@ import {UserService} from '../services/user.service'; import { StoreModule } from '@ngrx/store'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import {environment} from '../environments/environment'; -import {SessionCompanionIconsModule} from './shared/sc-icons/session-companion-icons.module'; import {reducers} from './store/models/app-state.model'; import {CharacterService} from '../services/character.service'; @@ -55,7 +54,6 @@ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), MatSidenavModule, MatToolbarModule, MatListModule, - SessionCompanionIconsModule, StoreModule.forRoot(reducers), StoreDevtoolsModule.instrument({ logOnly: environment.production diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html index 6b72c96..f727744 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html @@ -38,17 +38,9 @@
- - folder - Link 1 - - - folder - Link 2 - - - folder - Link 3 + + + {{(loggedCharacter.name.length>12)? (loggedCharacter.name | slice:0:12)+'..':(loggedCharacter.name)}} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts index 2739bdb..69c942d 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts @@ -5,6 +5,9 @@ import {CharacterService} from '../../../services/character.service'; import {Subscription} from 'rxjs'; import {ErrorResponse} from '../../../types/ErrorResponse'; import {HttpErrorResponse} from '@angular/common/http'; +import {LoggedCharactersViewModel} from '../../../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; +import {SessionCompanionIconsRegistry} from '../../shared/sc-icons/session-companion-icons-registry.service'; +import { first, take } from 'rxjs/operators'; @Component({ selector: 'app-game-master-dashboard', @@ -19,7 +22,10 @@ export class GameMasterDashboardComponent implements OnInit, OnDestroy { rightSidenavExpanded = false; rightSidenavTextExpanded = false; - constructor(private signalRService: GMSignalRService, private characterService: CharacterService) { + loggedCharacters: LoggedCharactersViewModel[]; + + constructor(private signalRService: GMSignalRService, private characterService: CharacterService, + private iconsRegister: SessionCompanionIconsRegistry) { this.SubscribeToEvents(); } @@ -45,20 +51,18 @@ export class GameMasterDashboardComponent implements OnInit, OnDestroy { } UpdateCharactersList(): void { - this.allSubscriptions.add( - this.characterService.getLoggedCharacters().subscribe((success) => { - console.log(success); + this.characterService.getLoggedCharacters().pipe(first()).subscribe((success) => { + this.loggedCharacters = success; }, - (error: ErrorResponse | HttpErrorResponse) => { + (error: ErrorResponse | HttpErrorResponse) => { if (error instanceof HttpErrorResponse) { error = error.error as ErrorResponse; } console.error(error.message); - })); + }); } private SubscribeToEvents(): void { - debugger this.signalRService.message.subscribe((message: string) => { if (message === 'New player connected' || message === 'Player disconnected') { this.UpdateCharactersList(); diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts index 0870b10..5815b11 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts @@ -1,31 +1,19 @@ import {Injectable} from '@angular/core'; -import { SessionCompanionIcon } from './icons/sc-icon.model'; +import { SessionCompanionIcon, scIcon } from './icons/sc-icon.model'; +import {MatIconRegistry} from '@angular/material'; +import {DomSanitizer} from '@angular/platform-browser'; @Injectable({ providedIn: 'root' }) export class SessionCompanionIconsRegistry { + constructor(private registry: MatIconRegistry, private sanitizer: DomSanitizer) { + } - private registry = new Map(); - - public registerIcons(icons: SessionCompanionIcon[]): void { - icons.forEach((icon: SessionCompanionIcon) => { - if (!this.registry.has(icon.name)) { - this.registry.set(icon.name, icon.data); - } + public registerIcons(): void { + const icons = require('./icons/sc-icon.model'); + Object.values(icons).forEach((icon: SessionCompanionIcon) => { + this.registry.addSvgIconLiteral(icon.name, this.sanitizer.bypassSecurityTrustHtml(icon.data)); }); } - - public registerIcon(icon: SessionCompanionIcon): void { - if (!this.registry.has(icon.name)) { - this.registry.set(icon.name, icon.data); - } - } - - public getIcon(iconName: string): string | undefined { - if (!this.registry.has(iconName)) { - console.warn(`We could not find the Icon with the name ${iconName}, did you add it to the Icon registry?`); - } - return this.registry.get(iconName); - } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts deleted file mode 100644 index 5752798..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {ChangeDetectionStrategy, Component, ElementRef, Inject, Input, Optional} from '@angular/core'; -import {SessionCompanionIconsRegistry} from './session-companion-icons-registry.service'; -import { DOCUMENT } from '@angular/common'; - -@Component({ - selector: 'app-sc-icons', - template: ` - - `, - styles: [':host::ng-deep svg{width: 50px; height: 50px}'], - changeDetection: ChangeDetectionStrategy.OnPush -}) -export class SessionCompanionIconsComponent { - - private svgIcon: SVGElement; - - @Input() - set name(iconName: string) { - if (this.svgIcon) { - this.element.nativeElement.removeChild(this.svgIcon); - } - const svgData = this.scIconRegistry.getIcon(iconName); - this.svgIcon = this.svgElementFromString(svgData); - this.element.nativeElement.appendChild(this.svgIcon); - } - - constructor(private element: ElementRef, private scIconRegistry: SessionCompanionIconsRegistry, - @Optional() @Inject(DOCUMENT) private document: any) { - } - - private svgElementFromString(svgContent: string): SVGElement { - const div = this.document.createElement('DIV'); - div.innerHTML = svgContent; - return div.querySelector('svg') || this.document.createElementNS('http://www.w3.org/2000/svg', 'path'); - } -} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts deleted file mode 100644 index eb9152a..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {NgModule} from '@angular/core'; -import {SessionCompanionIconsComponent} from './session-companion-icons.component'; - -@NgModule({ - declarations: [SessionCompanionIconsComponent], - imports: [], - exports: [ - SessionCompanionIconsComponent - ] -}) -export class SessionCompanionIconsModule { -} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts index b166270..ea14dc8 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts @@ -3,7 +3,7 @@ import {HttpClient} from '@angular/common/http'; import {Observable, of, throwError} from 'rxjs'; import {ErrorResponse} from '../types/ErrorResponse'; import {Either} from '../types/Either'; -import {switchMap} from 'rxjs/operators'; +import {switchMap, retry} from 'rxjs/operators'; import {LoggedCharactersViewModel} from '../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; Injectable({ @@ -23,7 +23,8 @@ export class CharacterService { } else { return throwError(response.right); } - }) + }), + retry(3) ); } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts index c61a496..36ea974 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts @@ -3,4 +3,5 @@ export interface LoggedCharactersViewModel { name: string; level: number; currentHealthPoints: number; + class: string; } diff --git a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs index 1545fc1..15b16d9 100644 --- a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs +++ b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs @@ -72,9 +72,12 @@ namespace SessionCompanion.Controllers public async Task, ErrorResponse>> GetLoggedUsersCharacters() { var connectedCharacters = _sessionHubData.ConnectedCharacters_Prop; - connectedCharacters.Add("a", 1); - connectedCharacters.Add("s", 2); - connectedCharacters.Add("d", 3); + if (_sessionHubData.ConnectedCharacters_Prop.Count() == 0) + { + connectedCharacters.Add("a", 1); + connectedCharacters.Add("s", 2); + connectedCharacters.Add("d", 3); + } var characters = await _service.GetBasicCharactersData(connectedCharacters.Values.ToList()); return characters.ToList(); From 665ef65ec0d3c2812949dbf6f1dc26594ec51fcd Mon Sep 17 00:00:00 2001 From: Natalia Gawron Date: Mon, 28 Dec 2020 17:03:53 +0100 Subject: [PATCH 11/26] conneted with backend - get user characters list --- .../ClientApp/src/app/app.module.ts | 4 +- .../select-character.component.html | 2 +- .../select-character.component.ts | 88 ++++++------------- .../components/sign-in/sign-in.component.ts | 5 +- .../src/app/store/actions/app.actions.ts | 13 ++- .../src/app/store/reducers/app.reducer.ts | 2 + .../src/services/character.service.ts | 30 +++++++ .../CharacterForLoginViewModel.ts | 7 ++ 8 files changed, 83 insertions(+), 68 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/CharacterForLoginViewModel.ts diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index a61df94..9a1d8a8 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -26,6 +26,7 @@ import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import {environment} from '../environments/environment'; import {SessionCompanionIconsModule} from './shared/sc-icons/session-companion-icons.module'; import {reducers} from './store/models/app-state.model'; +import {CharacterService} from "../services/character.service"; @NgModule({ declarations: [ @@ -61,7 +62,8 @@ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), }) ], providers: [ - UserService + UserService, + CharacterService ], bootstrap: [AppComponent] }) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html index fb89f12..69f592c 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html @@ -3,7 +3,7 @@
Select character
- + account_circle
{{character.name}}
arrow_forward diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts index 6360982..0581f28 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts @@ -1,83 +1,47 @@ -import { Component } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import { Router } from '@angular/router'; - -export interface Section { - name: string; - className: string; - level: number; -} +import {first} from "rxjs/operators"; +import {ClearUserId} from "../../store/actions/app.actions"; +import {ErrorResponse} from "../../../types/ErrorResponse"; +import {HttpErrorResponse} from "@angular/common/http"; +import {Store} from "@ngrx/store"; +import {AppState} from "../../store/models/app-state.model"; +import {CharacterService} from "../../../services/character.service"; +import {CharacterForLoginViewModel} from "../../../types/viewmodels/character-viewmodels/CharacterForLoginViewModel"; @Component({ selector: 'app-select-character', templateUrl: './select-character.component.html', styleUrls: ['./select-character.component.css'] }) -export class SelectCharacterComponent { - characters: Section[] = [ - { - name: 'Oweja', - className: 'warrior', - level: 1, - }, - { - name: 'James', - className: 'warrior', - level: 2, - }, - { - name: 'Legolas', - className: 'warrior', - level: 3, - }, - { - name: 'Oweja', - className: 'warrior', - level: 1, - }, - { - name: 'James', - className: 'warrior', - level: 2, - }, - { - name: 'Legolas', - className: 'warrior', - level: 3, - }, - { - name: 'Oweja', - className: 'warrior', - level: 1, - }, - { - name: 'James', - className: 'warrior', - level: 2, - }, - { - name: 'Legolas', - className: 'warrior', - level: 3, - } - ]; +export class SelectCharacterComponent implements OnInit { + charactersList: CharacterForLoginViewModel[]; - isExpanded = false; + constructor(private router: Router, private store: Store, private characterService: CharacterService) {} - collapse() { - this.isExpanded = false; + ngOnInit() { + this.getUserCharactersList(); } - toggle() { - this.isExpanded = !this.isExpanded; + getUserCharactersList() { + this.store.select(s => s.appStore.userId).pipe(first()).subscribe((userId) => { + this.characterService.getUserCharactersList(userId).pipe(first()).subscribe((charactersList) => { + this.charactersList = charactersList; + }, (error: ErrorResponse | HttpErrorResponse) => { + if(error instanceof HttpErrorResponse){ + error = error.error as ErrorResponse + } + console.error(error.message) + } ) + }); } - constructor(private router: Router) {} - onCharacterClick(){ this.router.navigate(['player']) } onArrowBackClick(){ + this.store.dispatch(new ClearUserId()) this.router.navigate(['login']) } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts index 9f2734b..1bf5263 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/sign-in/sign-in.component.ts @@ -9,6 +9,7 @@ import {AppStoreModel} from '../../store/models/app-store.model'; import {select, Store} from '@ngrx/store'; import {AddUserId} from '../../store/actions/app.actions'; import {AppState} from 'src/app/store/models/app-state.model'; +import {first} from "rxjs/operators"; @Component({ selector: 'app-sign-in', @@ -43,9 +44,9 @@ export class SignInComponent implements OnDestroy, OnInit { onLoginButtonClick() { let role = ''; - this.store.select(s => s.appStore.role).subscribe((v) => { + this.store.select(s => s.appStore.role).pipe(first()).subscribe((v) => { role = v; - }).unsubscribe(); + }); this.allSubscriptions.add( this.userService.tryLogin( this.signInFormGroup.get('signIn').value['username'], diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/app.actions.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/app.actions.ts index 4b2b34b..73a3584 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/app.actions.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/app.actions.ts @@ -3,7 +3,8 @@ import { Action } from '@ngrx/store'; export enum AppActionTypes { ADD_USER_ID = '[APP] Add user id', - ADD_ROLE = '[APP] Add role' + ADD_ROLE = '[APP] Add role', + CLEAR_USER_ID = '[APP] Clear user id' } export class AddUserId implements Action { @@ -20,4 +21,12 @@ export class AddRole implements Action { } } -export type AppAction = AddUserId | AddRole; +export class ClearUserId implements Action { + readonly type = AppActionTypes.CLEAR_USER_ID; + + constructor() { + } + +} + +export type AppAction = AddUserId | AddRole | ClearUserId; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/reducers/app.reducer.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/reducers/app.reducer.ts index 777c63a..d86c636 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/reducers/app.reducer.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/reducers/app.reducer.ts @@ -12,6 +12,8 @@ export function AppReducer(state: AppStoreModel = initialState, action: AppActio return {...state, userId: action.payload.userId}; case AppActionTypes.ADD_ROLE: return {...state, role: action.payload.role}; + case AppActionTypes.CLEAR_USER_ID: + return {...state, userId: null}; default: return state; } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts new file mode 100644 index 0000000..01180af --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts @@ -0,0 +1,30 @@ +import {Inject, Injectable} from '@angular/core'; +import {HttpClient, HttpParams} from '@angular/common/http'; +import {Observable, of, throwError} from 'rxjs'; +import {ErrorResponse} from '../types/ErrorResponse'; +import {Either} from '../types/Either'; +import {switchMap} from 'rxjs/operators'; +import {CharacterForLoginViewModel} from "../types/viewmodels/character-viewmodels/CharacterForLoginViewModel"; + +Injectable({ + providedIn: 'root' +}) +export class CharacterService { + private baseUrl = 'api/character/'; + constructor(private http: HttpClient, @Inject('BASE_URL') baseUrl: string) { + this.baseUrl = baseUrl + this.baseUrl; + } + + getUserCharactersList(userId: number): Observable { + const params = new HttpParams().set('userId', userId.toString()) + return this.http.get>(this.baseUrl + 'userCharactersList', {params}).pipe( + switchMap(response => { + if (response.isLeft) { + return of(response.left); + } else { + return throwError(response.right); + } + }) + ); + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/CharacterForLoginViewModel.ts b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/CharacterForLoginViewModel.ts new file mode 100644 index 0000000..fa9c0d8 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/CharacterForLoginViewModel.ts @@ -0,0 +1,7 @@ +export interface CharacterForLoginViewModel { + id: number; + userId: number; + name: string; + className: string; + level: number; +} From 18d1b75c4ab8003a81b120a2080975419a3fe3a8 Mon Sep 17 00:00:00 2001 From: Natalia Gawron Date: Mon, 28 Dec 2020 17:39:55 +0100 Subject: [PATCH 12/26] connected with backend - select character --- .../select-character.component.html | 2 +- .../select-character.component.ts | 4 +++- .../src/app/store/actions/app.actions.ts | 6 +++--- .../src/app/store/actions/player.action.ts | 15 +++++++++++++++ .../src/app/store/models/app-state.model.ts | 4 ++++ .../src/app/store/models/player-store.model.ts | 3 +++ .../src/app/store/reducers/player.reducer.ts | 15 +++++++++++++++ 7 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/player.action.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/player-store.model.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/store/reducers/player.reducer.ts diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html index 69f592c..5eae2cc 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.html @@ -6,7 +6,7 @@ account_circle
{{character.name}}
- arrow_forward + arrow_forward
{{character.className}} level: {{character.level}}
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts index 0581f28..5331821 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/select-character/select-character.component.ts @@ -8,6 +8,7 @@ import {Store} from "@ngrx/store"; import {AppState} from "../../store/models/app-state.model"; import {CharacterService} from "../../../services/character.service"; import {CharacterForLoginViewModel} from "../../../types/viewmodels/character-viewmodels/CharacterForLoginViewModel"; +import {AddCharacterId} from "../../store/actions/player.action"; @Component({ selector: 'app-select-character', @@ -36,7 +37,8 @@ export class SelectCharacterComponent implements OnInit { }); } - onCharacterClick(){ + onCharacterClick(characterId: number){ + this.store.dispatch(new AddCharacterId({characterId})) this.router.navigate(['player']) } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/app.actions.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/app.actions.ts index 73a3584..362b983 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/app.actions.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/app.actions.ts @@ -1,5 +1,4 @@ -import {AppStoreModel} from '../models/app-store.model'; -import { Action } from '@ngrx/store'; +import {Action} from '@ngrx/store'; export enum AppActionTypes { ADD_USER_ID = '[APP] Add user id', @@ -26,7 +25,8 @@ export class ClearUserId implements Action { constructor() { } - } + + export type AppAction = AddUserId | AddRole | ClearUserId; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/player.action.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/player.action.ts new file mode 100644 index 0000000..45c74d8 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/actions/player.action.ts @@ -0,0 +1,15 @@ +import {Action} from "@ngrx/store"; + +export enum PlayerActionTypes { + ADD_CHARACTER_ID= '[PLAYER] Add character id' +} + +export class AddCharacterId implements Action { + readonly type = PlayerActionTypes.ADD_CHARACTER_ID; + + constructor(public payload: {characterId: number}) { + + } +} + +export type PlayerAction = AddCharacterId; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts index 8d87023..7fda9a7 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/app-state.model.ts @@ -1,11 +1,15 @@ import {AppStoreModel} from './app-store.model'; import {ActionReducerMap} from '@ngrx/store'; import {AppReducer} from '../reducers/app.reducer'; +import {PlayerStoreModel} from "./player-store.model"; +import {PlayerReducer} from "../reducers/player.reducer"; export interface AppState { appStore: AppStoreModel; + playerStore: PlayerStoreModel; } export const reducers: ActionReducerMap = { appStore: AppReducer, + playerStore: PlayerReducer, }; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/player-store.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/player-store.model.ts new file mode 100644 index 0000000..8cc606f --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/models/player-store.model.ts @@ -0,0 +1,3 @@ +export interface PlayerStoreModel { + characterId: number; +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/store/reducers/player.reducer.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/reducers/player.reducer.ts new file mode 100644 index 0000000..33cc4b6 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/store/reducers/player.reducer.ts @@ -0,0 +1,15 @@ +import {PlayerStoreModel} from "../models/player-store.model"; +import {PlayerAction, PlayerActionTypes} from "../actions/player.action"; + +const initialState: PlayerStoreModel = { + characterId: null +}; + +export function PlayerReducer(state: PlayerStoreModel = initialState, action: PlayerAction) { + switch (action.type) { + case PlayerActionTypes.ADD_CHARACTER_ID: + return {...state, characterId: action.payload.characterId}; + default: + return state; + } +} From f75e20876b4f57b55fd833634b3b1e0fb7579d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Wed, 30 Dec 2020 11:38:58 +0100 Subject: [PATCH 13/26] SES-116 Fix Icons on right panel --- .../game-master-dashboard.component.html | 4 +- .../game-master-dashboard.component.ts | 6 +- .../shared/sc-icons/icons/sc-icon.model.ts | 105 ------------------ .../sc-icons/icons/svg-icons/barbarian.svg | 1 - .../shared/sc-icons/icons/svg-icons/bard.svg | 1 - .../sc-icons/icons/svg-icons/cleric.svg | 1 - .../shared/sc-icons/icons/svg-icons/druid.svg | 1 - .../sc-icons/icons/svg-icons/fighter.svg | 1 - .../shared/sc-icons/icons/svg-icons/monk.svg | 1 - .../sc-icons/icons/svg-icons/paladin.svg | 1 - .../sc-icons/icons/svg-icons/ranger.svg | 1 - .../shared/sc-icons/icons/svg-icons/rogue.svg | 1 - .../sc-icons/icons/svg-icons/sorcerer.svg | 1 - .../sc-icons/icons/svg-icons/warlock.svg | 1 - .../sc-icons/icons/svg-icons/wizard.svg | 1 - ...ession-companion-icons-registry.service.ts | 11 +- .../src/assets/icons/sc-icon.model.ts | 14 +++ .../src/assets/icons/svg-icons/barbarian.svg | 1 + .../src/assets/icons/svg-icons/bard.svg | 1 + .../src/assets/icons/svg-icons/cleric.svg | 1 + .../src/assets/icons/svg-icons/druid.svg | 1 + .../src/assets/icons/svg-icons/fighter.svg | 1 + .../src/assets/icons/svg-icons/monk.svg | 1 + .../src/assets/icons/svg-icons/paladin.svg | 1 + .../src/assets/icons/svg-icons/ranger.svg | 1 + .../src/assets/icons/svg-icons/rogue.svg | 1 + .../src/assets/icons/svg-icons/sorcerer.svg | 1 + .../src/assets/icons/svg-icons/warlock.svg | 1 + .../src/assets/icons/svg-icons/wizard.svg | 1 + 29 files changed, 37 insertions(+), 127 deletions(-) delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/barbarian.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/bard.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/cleric.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/druid.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/fighter.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/monk.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/paladin.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/ranger.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/rogue.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/sorcerer.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/warlock.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/wizard.svg diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html index f727744..da56f17 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html @@ -39,8 +39,8 @@ - - {{(loggedCharacter.name.length>12)? (loggedCharacter.name | slice:0:12)+'..':(loggedCharacter.name)}} + + {{(loggedCharacter.name.length>12)? (loggedCharacter.name | slice:0:12)+'..':(loggedCharacter.name)}} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts index 69c942d..5f6a7b4 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts @@ -6,8 +6,7 @@ import {Subscription} from 'rxjs'; import {ErrorResponse} from '../../../types/ErrorResponse'; import {HttpErrorResponse} from '@angular/common/http'; import {LoggedCharactersViewModel} from '../../../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; -import {SessionCompanionIconsRegistry} from '../../shared/sc-icons/session-companion-icons-registry.service'; -import { first, take } from 'rxjs/operators'; +import { first } from 'rxjs/operators'; @Component({ selector: 'app-game-master-dashboard', @@ -24,8 +23,7 @@ export class GameMasterDashboardComponent implements OnInit, OnDestroy { rightSidenavTextExpanded = false; loggedCharacters: LoggedCharactersViewModel[]; - constructor(private signalRService: GMSignalRService, private characterService: CharacterService, - private iconsRegister: SessionCompanionIconsRegistry) { + constructor(private signalRService: GMSignalRService, private characterService: CharacterService) { this.SubscribeToEvents(); } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts deleted file mode 100644 index 840ea40..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* 🤖 this file was generated by svg-to-ts*/ -export const scIconBarbarian: { - name: 'barbarian'; - data: string; -} = { - name: 'barbarian', - data: `` -}; -export const scIconBard: { - name: 'bard'; - data: string; -} = { - name: 'bard', - data: `` -}; -export const scIconCleric: { - name: 'cleric'; - data: string; -} = { - name: 'cleric', - data: `` -}; -export const scIconDruid: { - name: 'druid'; - data: string; -} = { - name: 'druid', - data: `` -}; -export const scIconFighter: { - name: 'fighter'; - data: string; -} = { - name: 'fighter', - data: `` -}; -export const scIconMonk: { - name: 'monk'; - data: string; -} = { - name: 'monk', - data: `` -}; -export const scIconPaladin: { - name: 'paladin'; - data: string; -} = { - name: 'paladin', - data: `` -}; -export const scIconRanger: { - name: 'ranger'; - data: string; -} = { - name: 'ranger', - data: `` -}; -export const scIconRogue: { - name: 'rogue'; - data: string; -} = { - name: 'rogue', - data: `` -}; -export const scIconSorcerer: { - name: 'sorcerer'; - data: string; -} = { - name: 'sorcerer', - data: `` -}; -export const scIconWarlock: { - name: 'warlock'; - data: string; -} = { - name: 'warlock', - data: `` -}; -export const scIconWizard: { - name: 'wizard'; - data: string; -} = { - name: 'wizard', - data: `` -}; -export type scIcon = - | 'barbarian' - | 'bard' - | 'cleric' - | 'druid' - | 'fighter' - | 'monk' - | 'paladin' - | 'ranger' - | 'rogue' - | 'sorcerer' - | 'warlock' - | 'wizard'; -export interface SessionCompanionIcon { - name: scIcon; - data: string; -} -export type SessionCompanionIconNameSubset< - T extends Readonly -> = T[number]['name']; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg deleted file mode 100644 index a4d948e..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg deleted file mode 100644 index 565ebe9..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg deleted file mode 100644 index df1b7e5..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg deleted file mode 100644 index 036adc9..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg deleted file mode 100644 index 4fa6997..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg deleted file mode 100644 index 3590be6..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg deleted file mode 100644 index 0fb47a7..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg deleted file mode 100644 index 4d9aca2..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg deleted file mode 100644 index 2e89550..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg deleted file mode 100644 index e26b851..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg deleted file mode 100644 index 329c82f..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg deleted file mode 100644 index c61b956..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts index 5815b11..6d48cad 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts @@ -1,5 +1,5 @@ import {Injectable} from '@angular/core'; -import { SessionCompanionIcon, scIcon } from './icons/sc-icon.model'; +import {scIcon} from '../../../assets/icons/sc-icon.model'; import {MatIconRegistry} from '@angular/material'; import {DomSanitizer} from '@angular/platform-browser'; @@ -11,9 +11,12 @@ export class SessionCompanionIconsRegistry { } public registerIcons(): void { - const icons = require('./icons/sc-icon.model'); - Object.values(icons).forEach((icon: SessionCompanionIcon) => { - this.registry.addSvgIconLiteral(icon.name, this.sanitizer.bypassSecurityTrustHtml(icon.data)); + this.loadIcons(Object.values(scIcon), '../assets/icons/svg-icons'); + } + + private loadIcons(iconKeys: string[], iconUrl: string): void { + iconKeys.forEach((icon: string) => { + this.registry.addSvgIcon(icon, this.sanitizer.bypassSecurityTrustResourceUrl(`${iconUrl}/${icon}.svg`)); }); } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts new file mode 100644 index 0000000..e3537d1 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts @@ -0,0 +1,14 @@ +export enum scIcon { + Barbarian = 'barbarian', + Bard = 'bard', + Cleric = 'cleric', + Druid = 'druid', + Fighter = 'fighter', + Monk = 'monk', + Paladin = 'paladin', + Ranger = 'ranger', + rogue = 'rogue', + Sorcerer = 'sorcerer', + Warlock = 'warlock', + Wizard = 'wizard' +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/barbarian.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/barbarian.svg new file mode 100644 index 0000000..ea18fd3 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/barbarian.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/bard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/bard.svg new file mode 100644 index 0000000..1e139d8 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/bard.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/cleric.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/cleric.svg new file mode 100644 index 0000000..f7a6586 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/cleric.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/druid.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/druid.svg new file mode 100644 index 0000000..8290333b --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/druid.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/fighter.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/fighter.svg new file mode 100644 index 0000000..0f55a43 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/fighter.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/monk.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/monk.svg new file mode 100644 index 0000000..dccf6ac --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/monk.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/paladin.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/paladin.svg new file mode 100644 index 0000000..615bc8f --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/paladin.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/ranger.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/ranger.svg new file mode 100644 index 0000000..8defce6 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/ranger.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/rogue.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/rogue.svg new file mode 100644 index 0000000..a5ebf42 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/rogue.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/sorcerer.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/sorcerer.svg new file mode 100644 index 0000000..6fa42fb --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/sorcerer.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/warlock.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/warlock.svg new file mode 100644 index 0000000..d84762e --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/warlock.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/wizard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/wizard.svg new file mode 100644 index 0000000..1df2853 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/wizard.svg @@ -0,0 +1 @@ + From a7aaacb2e56b79e109dd7d4de06e229a08fdd863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Wed, 30 Dec 2020 11:41:24 +0100 Subject: [PATCH 14/26] SES-116 Update icons rmd and package json --- .../SessionCompanion/ClientApp/package.json | 14 --------- .../src/app/shared/sc-icons/how-to.RMD | 29 ++---------------- .../src/app/shared/sc-icons/warning.png | Bin 3385 -> 0 bytes 3 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png diff --git a/SessionCompanion/SessionCompanion/ClientApp/package.json b/SessionCompanion/SessionCompanion/ClientApp/package.json index 35cdd9e..8d97cb5 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package.json @@ -6,23 +6,10 @@ "start": "ng serve", "build": "ng build", "build:ssr": "ng run SessionCompanion:server:dev", - "generate-icons": "svg-to-ts", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, - "svg-to-ts": { - "conversionType": "constants", - "srcFiles": [ - "./src/app/shared/sc-icons/icons/**/*.svg" - ], - "outputDirectory": "./src/app/shared/sc-icons/icons", - "interfaceName": "SessionCompanionIcon", - "typeName": "scIcon", - "prefix": "scIcon", - "fileName": "sc-icon.model", - "compileSources": true - }, "private": true, "dependencies": { "@angular/animations": "8.2.12", @@ -66,7 +53,6 @@ "karma-coverage-istanbul-reporter": "~2.1.0", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.2", - "svg-to-ts": "^6.0.0", "typescript": "3.5.3" }, "optionalDependencies": { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD index 5ba5504..b0d9081 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD @@ -1,29 +1,4 @@ Moduł został już dodany i wstrzyknięty do roota apki. -Aby dodać nową ikonkę, plik svg wstawiamy do folderu icons/svg-icons. -Następnie wpisujemy w konsoli polecenie: -npm run generate-icons - -Zostaną wtedy utworzone nowe klasy z dodaną ikonką. - -Jeśli po tym będziemy chcieli użyć gdzieś naszej ikonki, nie pojawi się ona... -Jest to spowodowane tym, że nie chcemy, aby aplikacja wczytywała w jednym momencie wszystkie nasze ikonki a jedynie te potrzebne -Musi więc ją dodać w odpowiednim momencie do rejestru, w innym wypadku w konsoli dostaniemy komunikat: -![img.png](warning.png) - -Teraz zarejestrujmy naszą ikonkę: - -Dodajemy w konstruktorze danego komponentu: -```typescript -iconRegister: SessionCompanionIconsRegistry -``` - -Następnie dodajemy interesującą nas ikonkę: -```typescript -this.iconRegister.registerIcon(scIconBarbarian); -``` - -Samą ikonkę ładujemy w tagu -```html - -``` +Aby dodać nową ikonkę, plik svg wstawiamy do folderu assets/icons/svg-icons. +Oraz dodajym kolejnego enuma w pliku sc-icon.model.ts diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png deleted file mode 100644 index d36ffcbb6a41427fd8599e13f441f4286f73b6ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3385 zcma)p@b#@;&+nh#AHP5D`*mH{{rcSZ{kmS){kq>*hMUW2IT>{s zF)=Z@KOF5m#Ka^(+xG9$QrokFBKpyGTTVxoC8L0Vi{ zRta#PdQ$dQdWyNp8|jptF#A07H3G1!%@!05B$yb&51JfNe#2bbX9rT&kpd7po(8=$ z{_S@KsbDL=gm2EhbuWf4^A{kPKEV!X10R0(`Rav=myHdK;Mw(}DDC)!gg+HdO8<6K zfl#Ei2lT@_nf~nQ!=J&E&LQq@<5yWZzuedwUENCD>c4JT%1?!~@!o&MUH>a~ko>iI zph@2D+YEGAC~EVGRa`YwFL z=h)C9tCYIrl_!5fUlp}^q1Crg8Hr^1`frqwxK_wu8vTN^X#H@YpafJ2Y=>LDgWE zc3#U#(q5%hyL^4Ht%1SxG=b(Qy-)!m(S6~Ps^ebai} zZe3lM2bL#_srl_C+^mXO+Vq`~t8hejh_0Cdp=(w++c=*AUiV;)NAwS2b8W7d zcjO$N&-Y-t2P#`?{^?utT5}968R^rP8uul}?NiMHl9Jy8WcFdv4&JAG8f0WZvWyZR z6_9El*bk(9*Doom9u=RsD3X{mHt>Q46q|2Wx`QXp8Vrx_dpA+KJ^(jzuDXD|HD$5J zk`>-+TcTyi|3i%FTsUnylBQIS@5PgS^Hu04VSf>}TqdmC zJTjfPb;R6g)8M|s*TQy}(J`wM# zPF++qyx%4vgghLF%7nzP6)YrcFpCcmp@*8kwn9#uinD{Xail#E{j7*4CZ?!OM5!;5 zM@MqLSv>4@DbQ(x6!Nx5MJHYtuAQUBCrwK*=>D=iHTt0jzfAEt2Ts-1cVm<+`EK>c zP5lH3KmNK{qgQIL;~+4vHTB`5S+zI+pY!Q7LWmpiY)?%rp0$fO=BY=u;xU5F0a z-+L^aJc$@e#q6L~dJ+u9}=bE1!CkY}LJ4^D0-^^S4QSdW_R}XC;Es^fxGHk_{7fXF#VZVP~`Yte= z-vgQy`l;b76t|5aFlOS!hO@LZfVO1xx(>z1El(v&N=^dJAN$+Cmwy{3Aux8oUSm-s zES!ig4(n5L$3^S)-vq`eta2V-&T$5?)#h~I82$RDJ+{{iT2rN{e54&V)sZXBGghZVh%)peJ`%zZyJY?T+MV>AVXcaLd`V#s^80Jf z^!OytBG%|f+Wr=_Bc87sDz?konVN4F=RFpL2TxTC_pKdITGe8yIpT*n~ikG`yJo9lq7;_E4vi69E-&s3v;u7C9HZks;xk& zDZjwN1ZS>7loNK(S5!Ul&|qE1^wm8pDu^6hkl@h^@8>CoNCf%MzB;3-x)=#eYB9md z=3KhsduG9i>3t>=4j7?bqLFtp(Tcg1)R|5fiWz2nSsPjCG6znN%}$S2MWv`- z$eDr&0WxPeI9?xOZ8~t9ez*B^O`?;ZS}zOF_tK1W_*&9 z<%kpmi!goUFy9xwDkIwI6vlc=C*6^yUI++U%7nlXh#3qGavGcev^@ng$?If;v}`FQ z1+|_gEvU0EHxGCj>QvK`69&0$d4k*zfLwelN1?s(c&Odk;rsIMGF#TVRtO>8*Uv7{ zmzOD@%f4nnmdYsQas9q-ldi>;hjshlX4ZmtWXY{ZwKe=~`rWFOPkpzx;`CEK>N!fM zBX<9_iS&qeyWk$cJI zDer4(8P`~0%-<}Rk|zZbF5EP3JG$B!OJxA4{8@MbX*+>yamdZW@)x3$G|r55D`vCc zJ;!r@|9D3-*nglD$gJ-y7r?!vZw=F8v-?(bx5Vjhhu(2Ad+~m%qf)cyRB(+)Z3aw| z0t0wxp|7PKGO@>W))q*7lEy9J+v{25X=D?PFNn=MBF=#^!&V-$_9(A3F6=|m0TFx3 z)NMd~%4dEsB7c1u%e`}LFevG=-%}s!{TfK7uN!r~TrXptZFwkabZ-=D9);co0@XDO zbbM1s-BvN+xzRL} z8V;?b45_0F_fk6?0c!_f^(a7AV7O zC2Ht>$noAZ=V9H1@EGf!G*2ya?Q!`2A_iwNND{h?r_7_5rZ5YaqLQtMaU4Obar&n> z+#>vFvp>ojT0aV)(n-B+;81Vdl#UfOGy>91F7P5(cxIQ8uQRS~f8OE9HHaDl89Wy1 z|3MQlF*DB~X35<2!rt=XMCvXQ)#sFM(Q{fC@hZMM{Zdo(TzeIZ*(zj^}MLmV{W$Y?n%w#1n8Bq^1#kVpn<6KjlB4!KmN> From 329ac81ed233e82a9eb87cc96516c82f39a07a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Wed, 30 Dec 2020 11:43:57 +0100 Subject: [PATCH 15/26] SES-116 backend fix --- .../SessionCompanion/Controllers/CharacterController.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs index 15b16d9..d35eb6f 100644 --- a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs +++ b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs @@ -72,12 +72,6 @@ namespace SessionCompanion.Controllers public async Task, ErrorResponse>> GetLoggedUsersCharacters() { var connectedCharacters = _sessionHubData.ConnectedCharacters_Prop; - if (_sessionHubData.ConnectedCharacters_Prop.Count() == 0) - { - connectedCharacters.Add("a", 1); - connectedCharacters.Add("s", 2); - connectedCharacters.Add("d", 3); - } var characters = await _service.GetBasicCharactersData(connectedCharacters.Values.ToList()); return characters.ToList(); From 02d7304de347bdb2d86d7770abf6343061829f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Wed, 30 Dec 2020 12:17:31 +0100 Subject: [PATCH 16/26] prettier config --- .../SessionCompanion/ClientApp/.prettierrc | 3 + .../ClientApp/package-lock.json | 707 +----------------- .../SessionCompanion/ClientApp/package.json | 1 + .../game-master-dashboard.component.html | 142 ++-- .../game-master-dashboard.component.ts | 52 +- 5 files changed, 145 insertions(+), 760 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/.prettierrc diff --git a/SessionCompanion/SessionCompanion/ClientApp/.prettierrc b/SessionCompanion/SessionCompanion/ClientApp/.prettierrc new file mode 100644 index 0000000..544138b --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/.prettierrc @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/package-lock.json b/SessionCompanion/SessionCompanion/ClientApp/package-lock.json index a4391a2..d012404 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package-lock.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package-lock.json @@ -2976,12 +2976,6 @@ "integrity": "sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA==", "dev": true }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "@types/q": { "version": "0.0.32", "resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", @@ -3880,12 +3874,6 @@ "multicast-dns-service-types": "^1.1.0" } }, - "boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", - "dev": true - }, "bootstrap": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.1.tgz", @@ -4321,12 +4309,6 @@ "restore-cursor": "^3.1.0" } }, - "cli-spinners": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.5.0.tgz", - "integrity": "sha512-PC+AmIuK04E6aeSs/pUccSujsTzBhu4HzC2dL+CfJB/Jcc2qTRbEwZQDfIUpt2Xl8BodYBEq8w4fc0kU2I9DjQ==", - "dev": true - }, "cli-width": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", @@ -4361,54 +4343,6 @@ "shallow-clone": "^3.0.0" } }, - "coa": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", - "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", - "dev": true, - "requires": { - "@types/q": "^1.5.1", - "chalk": "^2.4.1", - "q": "^1.1.2" - }, - "dependencies": { - "@types/q": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", - "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -4947,24 +4881,6 @@ "integrity": "sha1-Mh9s9zeCpv91ERE5D8BeLGV9jJs=", "dev": true }, - "css-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.1.0.tgz", - "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==", - "dev": true, - "requires": { - "boolbase": "^1.0.0", - "css-what": "^3.2.1", - "domutils": "^1.7.0", - "nth-check": "^1.0.2" - } - }, - "css-select-base-adapter": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", - "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", - "dev": true - }, "css-selector-tokenizer": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz", @@ -5016,30 +4932,6 @@ } } }, - "css-tree": { - "version": "1.0.0-alpha.37", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", - "integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==", - "dev": true, - "requires": { - "mdn-data": "2.0.4", - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "css-what": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz", - "integrity": "sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==", - "dev": true - }, "cssauron": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/cssauron/-/cssauron-1.4.0.tgz", @@ -5049,39 +4941,6 @@ "through": "X.X.X" } }, - "csso": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", - "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", - "dev": true, - "requires": { - "css-tree": "^1.1.2" - }, - "dependencies": { - "css-tree": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.2.tgz", - "integrity": "sha512-wCoWush5Aeo48GLhfHPbmvZs59Z+M7k5+B1xDnXbdWNcEF423DoFdqSWE0PM5aNk5nI5cp1q7ms36zGApY/sKQ==", - "dev": true, - "requires": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" - } - }, - "mdn-data": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", - "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -5189,23 +5048,6 @@ } } }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "requires": { - "clone": "^1.0.2" - }, - "dependencies": { - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - } - } - }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -5412,24 +5254,6 @@ "void-elements": "^2.0.0" } }, - "dom-serializer": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", - "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "entities": "^2.0.0" - }, - "dependencies": { - "domelementtype": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz", - "integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==", - "dev": true - } - } - }, "domain-browser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", @@ -5451,27 +5275,11 @@ "isomorphic-fetch": "^2.2.1" } }, - "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", - "dev": true - }, "domino": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/domino/-/domino-2.1.4.tgz", "integrity": "sha512-l70mlQ7IjPKC8kT7GljQXJZmt5OqFL+RE91ik5y5WWQtsd9wP8R7gpFnNu96fK5MqAAZRXfLLsnzKtkty5fWGQ==" }, - "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, "duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -5685,12 +5493,6 @@ "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", "dev": true }, - "entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", - "dev": true - }, "err-code": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", @@ -7375,12 +7177,6 @@ "is-extglob": "^2.1.1" } }, - "is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "dev": true - }, "is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", @@ -8240,12 +8036,6 @@ "immediate": "~3.0.5" } }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, "load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -8297,90 +8087,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", - "dev": true - }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, - "lodash.kebabcase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", - "integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=", - "dev": true - }, - "lodash.snakecase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", - "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=", - "dev": true - }, - "log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", - "dev": true, - "requires": { - "chalk": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "log4js": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/log4js/-/log4js-4.5.1.tgz", @@ -8555,12 +8267,6 @@ "safe-buffer": "^5.1.2" } }, - "mdn-data": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", - "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", - "dev": true - }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -9248,15 +8954,6 @@ "set-blocking": "~2.0.0" } }, - "nth-check": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", - "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", - "dev": true, - "requires": { - "boolbase": "~1.0.0" - } - }, "num2fraction": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", @@ -9454,73 +9151,6 @@ "isobject": "^3.0.1" } }, - "object.values": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", - "integrity": "sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1", - "has": "^1.0.3" - }, - "dependencies": { - "es-abstract": { - "version": "1.18.0-next.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", - "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.0", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - }, - "is-callable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", - "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", - "dev": true - }, - "is-regex": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", - "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", - "dev": true, - "requires": { - "has-symbols": "^1.0.1" - } - }, - "object-inspect": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", - "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", - "dev": true - }, - "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - } - } - } - }, "obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -9595,88 +9225,6 @@ "is-wsl": "^1.1.0" } }, - "ora": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.1.0.tgz", - "integrity": "sha512-9tXIMPvjZ7hPTbk8DFq1f7Kow/HU/pQYB60JbNq+QnGwcyhWVZaQ4hM9zQDEsPxw/muLpgiHSaumUZxCAmod/w==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.4.0", - "is-interactive": "^1.0.0", - "log-symbols": "^4.0.0", - "mute-stream": "0.0.8", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "original": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", @@ -9865,23 +9413,6 @@ "readable-stream": "^2.1.5" } }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - }, - "dependencies": { - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - } - } - }, "parse-asn1": { "version": "5.1.5", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", @@ -10217,9 +9748,9 @@ "dev": true }, "prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", + "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", "dev": true }, "private": { @@ -10526,7 +10057,8 @@ "q": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", - "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=" + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", + "optional": true }, "qjobs": { "version": "1.2.0", @@ -11077,7 +10609,8 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "optional": true }, "schema-utils": { "version": "1.0.0", @@ -11923,12 +11456,6 @@ "figgy-pudding": "^3.5.1" } }, - "stable": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", - "dev": true - }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -12208,187 +11735,6 @@ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "optional": true }, - "svg-to-ts": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/svg-to-ts/-/svg-to-ts-6.0.0.tgz", - "integrity": "sha512-QdznpIJfuTjP//zY007BhOYAe4ZOII1XviNgmvhgfEnl6MxTyLJWL20JgECvjGJHD+F8DqKOnt7YU7UmUFD6LQ==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "commander": "^4.0.1", - "cosmiconfig": "^6.0.0", - "glob": "^7.1.6", - "lodash.camelcase": "^4.3.0", - "lodash.kebabcase": "^4.1.1", - "lodash.snakecase": "^4.1.1", - "ora": "^5.1.0", - "prettier": "^1.19.1", - "svgo": "^1.3.2", - "typescript": "^3.7.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true - }, - "cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "parse-json": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", - "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", - "dev": true - } - } - }, - "svgo": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz", - "integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "coa": "^2.0.2", - "css-select": "^2.0.0", - "css-select-base-adapter": "^0.1.1", - "css-tree": "1.0.0-alpha.37", - "csso": "^4.0.2", - "js-yaml": "^3.13.1", - "mkdirp": "~0.5.1", - "object.values": "^1.1.0", - "sax": "~1.2.4", - "stable": "^0.1.8", - "unquote": "~1.1.1", - "util.promisify": "~1.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", @@ -12700,6 +12046,12 @@ } } }, + "tslint-config-prettier": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz", + "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==", + "dev": true + }, "tsutils": { "version": "2.29.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", @@ -12860,12 +12212,6 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, - "unquote": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", - "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", - "dev": true - }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -12990,18 +12336,6 @@ "object.getownpropertydescriptors": "^2.0.3" } }, - "util.promisify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", - "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.2", - "has-symbols": "^1.0.1", - "object.getownpropertydescriptors": "^2.1.0" - } - }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -13766,15 +13100,6 @@ "minimalistic-assert": "^1.0.0" } }, - "wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, - "requires": { - "defaults": "^1.0.3" - } - }, "webdriver-js-extender": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz", @@ -14992,12 +14317,6 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "optional": true }, - "yaml": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", - "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", - "dev": true - }, "yargs": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", diff --git a/SessionCompanion/SessionCompanion/ClientApp/package.json b/SessionCompanion/SessionCompanion/ClientApp/package.json index 8d97cb5..5e89112 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package.json @@ -53,6 +53,7 @@ "karma-coverage-istanbul-reporter": "~2.1.0", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.2", + "prettier": "2.2.1", "typescript": "3.5.3" }, "optionalDependencies": { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html index da56f17..34918b5 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html @@ -1,48 +1,96 @@ -
- - -
- -
- - - - folder - Link 1 - - - folder - Link 2 - - - folder - Link 3 - - -
- - - SessionCompanion - - - -
- - -
- - - - - {{(loggedCharacter.name.length>12)? (loggedCharacter.name | slice:0:12)+'..':(loggedCharacter.name)}} - - -
-
+
+ + +
+ +
+ + + + folder + Link 1 + + + folder + Link 2 + + + folder + Link 3 + + +
+ + + SessionCompanion + + + +
+ + +
+ + + + + {{ + loggedCharacter.name.length > 12 + ? (loggedCharacter.name | slice: 0:12) + '..' + : loggedCharacter.name + }} + + +
+
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts index 5f6a7b4..d93a20e 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts @@ -1,18 +1,21 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; -import {animateText, onSideNavChange} from '../../shared/animations/sidenav-animations'; -import {GMSignalRService} from '../../shared/signalR-service/gm-signalR.service'; -import {CharacterService} from '../../../services/character.service'; -import {Subscription} from 'rxjs'; -import {ErrorResponse} from '../../../types/ErrorResponse'; -import {HttpErrorResponse} from '@angular/common/http'; -import {LoggedCharactersViewModel} from '../../../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { + animateText, + onSideNavChange, +} from '../../shared/animations/sidenav-animations'; +import { GMSignalRService } from '../../shared/signalR-service/gm-signalR.service'; +import { CharacterService } from '../../../services/character.service'; +import { Subscription } from 'rxjs'; +import { ErrorResponse } from '../../../types/ErrorResponse'; +import { HttpErrorResponse } from '@angular/common/http'; +import { LoggedCharactersViewModel } from '../../../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; import { first } from 'rxjs/operators'; @Component({ selector: 'app-game-master-dashboard', templateUrl: './game-master-dashboard.component.html', styleUrls: ['./game-master-dashboard.component.css'], - animations: [onSideNavChange, animateText] + animations: [onSideNavChange, animateText], }) export class GameMasterDashboardComponent implements OnInit, OnDestroy { allSubscriptions = new Subscription(); @@ -23,7 +26,10 @@ export class GameMasterDashboardComponent implements OnInit, OnDestroy { rightSidenavTextExpanded = false; loggedCharacters: LoggedCharactersViewModel[]; - constructor(private signalRService: GMSignalRService, private characterService: CharacterService) { + constructor( + private signalRService: GMSignalRService, + private characterService: CharacterService + ) { this.SubscribeToEvents(); } @@ -49,20 +55,28 @@ export class GameMasterDashboardComponent implements OnInit, OnDestroy { } UpdateCharactersList(): void { - this.characterService.getLoggedCharacters().pipe(first()).subscribe((success) => { - this.loggedCharacters = success; - }, - (error: ErrorResponse | HttpErrorResponse) => { - if (error instanceof HttpErrorResponse) { - error = error.error as ErrorResponse; + this.characterService + .getLoggedCharacters() + .pipe(first()) + .subscribe( + (success) => { + this.loggedCharacters = success; + }, + (error: ErrorResponse | HttpErrorResponse) => { + if (error instanceof HttpErrorResponse) { + error = error.error as ErrorResponse; + } + console.error(error.message); } - console.error(error.message); - }); + ); } private SubscribeToEvents(): void { this.signalRService.message.subscribe((message: string) => { - if (message === 'New player connected' || message === 'Player disconnected') { + if ( + message === 'New player connected' || + message === 'Player disconnected' + ) { this.UpdateCharactersList(); } }); From 543bc41f3f95185d3afebd32c84fe526609e2366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Fri, 1 Jan 2021 22:14:01 +0100 Subject: [PATCH 17/26] Added base for ability cards --- .../ClientApp/src/app/app.module.ts | 2 ++ .../ability-card/ability-card.component.css | 11 ++++++++ .../ability-card/ability-card.component.html | 19 ++++++++++++++ .../ability-card.component.spec.ts | 25 +++++++++++++++++++ .../ability-card/ability-card.component.ts | 15 +++++++++++ .../player-dashboard.component.html | 5 ++++ .../player-dashboard.component.ts | 15 +++++++++-- .../src/assets/icons/sc-icon.model.ts | 2 +- .../ability-viewmodels/AbilityViewModel.ts | 11 ++++++++ .../ability-viewmodels/SkillViewModel.ts | 5 ++++ 10 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.spec.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/AbilityViewModel.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/SkillViewModel.ts diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index 29d4a9b..d829109 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -26,6 +26,7 @@ import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import {environment} from '../environments/environment'; import {reducers} from './store/models/app-state.model'; import {CharacterService} from '../services/character.service'; +import { AbilityCardComponent } from './components/ability-card/ability-card.component'; @NgModule({ declarations: [ @@ -36,6 +37,7 @@ import {CharacterService} from '../services/character.service'; GameMasterDashboardComponent, PlayerDashboardComponent, SelectCharacterComponent, + AbilityCardComponent, ], imports: [ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css new file mode 100644 index 0000000..9f85d1b --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css @@ -0,0 +1,11 @@ +#main{ + width: 480px; + height: 480px; +} +#main>.mat-card{ + padding: 0px; +} +.diagonal-line{ + width:100px; + background:linear-gradient(45deg,#ffffff 49%,#aaa 50%,#ffffff 51%); +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html new file mode 100644 index 0000000..5daac83 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html @@ -0,0 +1,19 @@ +
+ + + {{ability.value}} +
+ {{ability.modification}} +
+ {{ability.name}} +
+
+ {{ability.savingthrows}} +
+
+ + + + +
+
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.spec.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.spec.ts new file mode 100644 index 0000000..f8de036 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AbilityCardComponent } from './ability-card.component'; + +describe('StatisticCardComponent', () => { + let component: AbilityCardComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AbilityCardComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AbilityCardComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts new file mode 100644 index 0000000..2f8e4f5 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts @@ -0,0 +1,15 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { AbilityViewModel } from '../../../types/viewmodels/ability-viewmodels/AbilityViewModel'; + +@Component({ + selector: 'app-ability-card', + templateUrl: './ability-card.component.html', + styleUrls: ['./ability-card.component.css'], +}) +export class AbilityCardComponent implements OnInit { + @Input() ability: AbilityViewModel; + + constructor() {} + + ngOnInit() {} +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html index e69de29..a9dd20f 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html @@ -0,0 +1,5 @@ +

+

+

+

+ diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts index 9ed3789..2c99938 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts @@ -1,13 +1,24 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { AbilityViewModel } from '../../../types/viewmodels/ability-viewmodels/AbilityViewModel'; @Component({ selector: 'app-player-dashboard', templateUrl: './player-dashboard.component.html', - styleUrls: ['./player-dashboard.component.css'] + styleUrls: ['./player-dashboard.component.css'], }) export class PlayerDashboardComponent { isExpanded = false; + test: AbilityViewModel = { + id: 1, + name: 'Dexterity', + value: 20, + modification: 3, + savingthrows: 1, + canSaveThrows: false, + skills: [], + }; + collapse() { this.isExpanded = false; } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts index e3537d1..3faceea 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts @@ -10,5 +10,5 @@ export enum scIcon { rogue = 'rogue', Sorcerer = 'sorcerer', Warlock = 'warlock', - Wizard = 'wizard' + Wizard = 'wizard', } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/AbilityViewModel.ts b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/AbilityViewModel.ts new file mode 100644 index 0000000..1ca9248 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/AbilityViewModel.ts @@ -0,0 +1,11 @@ +import {SkillViewModel} from './SkillViewModel'; + +export interface AbilityViewModel { + id: number; + name: string; + value: number; + modification: number; + savingthrows: number; + canSaveThrows: boolean; + skills: SkillViewModel[]; +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/SkillViewModel.ts b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/SkillViewModel.ts new file mode 100644 index 0000000..94418d4 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/SkillViewModel.ts @@ -0,0 +1,5 @@ +export interface SkillViewModel { + name: string; + value: number; + can: boolean; +} From 45288b2e3e1908bd8995f0b5d030d519cf898e8c Mon Sep 17 00:00:00 2001 From: Natalia Gawron Date: Sat, 2 Jan 2021 00:40:54 +0100 Subject: [PATCH 18/26] SES-117 implemented basic player dashboard page --- .../player-dashboard.component.css | 38 +++++++++++++ .../player-dashboard.component.html | 57 +++++++++++++++++++ .../player-dashboard.component.ts | 3 +- 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css index e69de29..8bb2f59 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css @@ -0,0 +1,38 @@ +@import "../../../styles.css"; + +.menu-spacer { + flex: 1 1 auto; +} + +.root-container { + height: calc(100vh - 64px); +} + +@media (max-width: 768px) { + .root-container { + height: calc(100vh - 58px); + } +} + +.sidenav-container +{ + flex: 1; + height: 100%; +} +.content{ + background-color: #102028; + color: #df7c0f; +} + +.navbar { + background-color: #df7c0f; + color: #e9cca7; +} + +.sidenav { + background-color: #102028; +} + +.mat-list-item.active{ + color: #e9cca7; +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html index e69de29..5777963 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html @@ -0,0 +1,57 @@ +
+ + + + +
+ Session Companion +
+
+
+ + + + + + + home + Home + + + + query_stats + Statistic and throws + + + + local_mall + Equipment + + + + brightness_4 + Spells + + + + account_circle + Profile + + + + shopping_cart + Shop + + + + exit_to_app + Log out + + + + + Main content + +
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts index 9ed3789..b43dd5f 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts @@ -6,7 +6,8 @@ import { Component } from '@angular/core'; styleUrls: ['./player-dashboard.component.css'] }) export class PlayerDashboardComponent { - isExpanded = false; + isExpanded = false + selected = false; collapse() { this.isExpanded = false; From 03bca2c11f09ff29d5773e9281972bc0410ecc9b Mon Sep 17 00:00:00 2001 From: Natalia Gawron Date: Sat, 2 Jan 2021 00:43:52 +0100 Subject: [PATCH 19/26] SES-117 small changes --- .../player-dashboard/player-dashboard.component.css | 5 ++--- .../player-dashboard/player-dashboard.component.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css index 8bb2f59..cc4b1d7 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css @@ -14,12 +14,11 @@ } } -.sidenav-container -{ +.sidenav-container { flex: 1; height: 100%; } -.content{ +.content { background-color: #102028; color: #df7c0f; } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts index b43dd5f..3b42801 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts @@ -6,7 +6,7 @@ import { Component } from '@angular/core'; styleUrls: ['./player-dashboard.component.css'] }) export class PlayerDashboardComponent { - isExpanded = false + isExpanded = false; selected = false; collapse() { From 809362175de484e776bf49bc4370491b956beef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20G=C3=B3rzy=C5=84ski?= Date: Sat, 2 Jan 2021 17:32:45 +0100 Subject: [PATCH 20/26] SES-120 Added necessary Jsons --- .../JsonData/armors.json | 236 ++ .../JsonData/otherEquipments.json | 1898 +++++++++++++++++ .../JsonData/weapons.json | 1450 +++++++++++++ 3 files changed, 3584 insertions(+) create mode 100644 SessionCompanion/SessionCompanion.Database/JsonData/armors.json create mode 100644 SessionCompanion/SessionCompanion.Database/JsonData/otherEquipments.json create mode 100644 SessionCompanion/SessionCompanion.Database/JsonData/weapons.json diff --git a/SessionCompanion/SessionCompanion.Database/JsonData/armors.json b/SessionCompanion/SessionCompanion.Database/JsonData/armors.json new file mode 100644 index 0000000..a2c4772 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/JsonData/armors.json @@ -0,0 +1,236 @@ +[ + { + "index": 38, + "name": "Padded", + "equipment_category": "Armor", + "armor_category": "Light", + "armor_class": { + "base": 11, + "dex_bonus": true, + "max_bonus": null + }, + "str_minimum": 0, + "stealth_disadvantage": true, + "weight": 8, + "cost": { + "quantity": 5, + "unit": "gp" + } + }, + { + "index": 39, + "name": "Leather", + "equipment_category": "Armor", + "armor_category": "Light", + "armor_class": { + "base": 11, + "dex_bonus": true, + "max_bonus": null + }, + "str_minimum": 0, + "stealth_disadvantage": false, + "weight": 10, + "cost": { + "quantity": 10, + "unit": "gp" + } + }, + { + "index": 40, + "name": "Studded Leather", + "equipment_category": "Armor", + "armor_category": "Light", + "armor_class": { + "base": 12, + "dex_bonus": true, + "max_bonus": null + }, + "str_minimum": 0, + "stealth_disadvantage": false, + "weight": 13, + "cost": { + "quantity": 45, + "unit": "gp" + } + }, + { + "index": 41, + "name": "Hide", + "equipment_category": "Armor", + "armor_category": "Medium", + "armor_class": { + "base": 12, + "dex_bonus": true, + "max_bonus": 2 + }, + "str_minimum": 0, + "stealth_disadvantage": false, + "weight": 12, + "cost": { + "quantity": 10, + "unit": "gp" + } + }, + { + "index": 42, + "name": "Chain Shirt", + "equipment_category": "Armor", + "armor_category": "Medium", + "armor_class": { + "base": 13, + "dex_bonus": true, + "max_bonus": 2 + }, + "str_minimum": 0, + "stealth_disadvantage": false, + "weight": 20, + "cost": { + "quantity": 50, + "unit": "gp" + } + }, + { + "index": 43, + "name": "Scale Mail", + "equipment_category": "Armor", + "armor_category": "Medium", + "armor_class": { + "base": 14, + "dex_bonus": true, + "max_bonus": 2 + }, + "str_minimum": 0, + "stealth_disadvantage": true, + "weight": 45, + "cost": { + "quantity": 50, + "unit": "gp" + } + }, + { + "index": 44, + "name": "Breastplate", + "equipment_category": "Armor", + "armor_category": "Medium", + "armor_class": { + "base": 14, + "dex_bonus": true, + "max_bonus": 2 + }, + "str_minimum": 0, + "stealth_disadvantage": false, + "weight": 20, + "cost": { + "quantity": 400, + "unit": "gp" + } + }, + { + "index": 45, + "name": "Half Plate", + "equipment_category": "Armor", + "armor_category": "Medium", + "armor_class": { + "base": 15, + "dex_bonus": true, + "max_bonus": 2 + }, + "str_minimum": 0, + "stealth_disadvantage": true, + "weight": 40, + "cost": { + "quantity": 750, + "unit": "gp" + } + }, + { + "index": 46, + "name": "Ring Mail", + "equipment_category": "Armor", + "armor_category": "Heavy", + "armor_class": { + "base": 14, + "dex_bonus": false, + "max_bonus": null + }, + "str_minimum": 0, + "stealth_disadvantage": true, + "weight": 40, + "cost": { + "quantity": 30, + "unit": "gp" + } + }, + { + "index": 47, + "name": "Chain Mail", + "equipment_category": "Armor", + "armor_category": "Heavy", + "armor_class": { + "base": 16, + "dex_bonus": false, + "max_bonus": null + }, + "str_minimum": 13, + "stealth_disadvantage": true, + "weight": 55, + "cost": { + "quantity": 75, + "unit": "gp" + } + }, + { + "index": 48, + "name": "Splint", + "equipment_category": "Armor", + "armor_category": "Heavy", + "armor_class": { + "base": 17, + "dex_bonus": false, + "max_bonus": null + }, + "str_minimum": 15, + "stealth_disadvantage": true, + "weight": 60, + "cost": { + "quantity": 200, + "unit": "gp" + } + }, + { + "index": 49, + "name": "Plate", + "equipment_category": "Armor", + "armor_category": "Heavy", + "armor_class": { + "base": 18, + "dex_bonus": false, + "max_bonus": null + }, + "str_minimum": 15, + "stealth_disadvantage": true, + "weight": 65, + "cost": { + "quantity": 1500, + "unit": "gp" + } + }, + { + "index": 50, + "name": "Shield", + "equipment_category": "Armor", + "armor_category": "Shield", + "armor_class": { + "base": 2, + "dex_bonus": false, + "max_bonus": null + }, + "str_minimum": 0, + "stealth_disadvantage": false, + "weight": 6, + "cost": { + "quantity": 10, + "unit": "gp" + } + } +] diff --git a/SessionCompanion/SessionCompanion.Database/JsonData/otherEquipments.json b/SessionCompanion/SessionCompanion.Database/JsonData/otherEquipments.json new file mode 100644 index 0000000..ef3626f --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/JsonData/otherEquipments.json @@ -0,0 +1,1898 @@ +[ + { + "index": 51, + "name": "Abacus", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 2, + "url": "http://www.dnd5eapi.co/api/equipment/51" + }, + { + "index": 52, + "name": "Acid (vial)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "As an action, you can splash the contents of this vial onto a creature within 5 feet of you or throw the vial up to 20 feet, shattering it on impact. In either case, make a ranged attack against a creature or object, treating the acid as an improvised weapon.", + "On a hit, the target takes 2d6 acid damage." + ], + "url": "http://www.dnd5eapi.co/api/equipment/52" + }, + { + "index": 53, + "name": "Alchemist's fire (flask)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 50, + "unit": "gp" + }, + "desc": [ + "This sticky, adhesive fluid ignites when exposed to air.", + "As an action, you can throw this flask up to 20 feet, shattering it on impact. Make a ranged attack against a creature or object, treating the alchemist's fire as an improvised weapon.", + "On a hit, the target takes 1d4 fire damage at the start of each of its turns. A creature can end this damage by using its action to make a DC 10 Dexterity check to extinguish the flames." + ], + "weight": 1, + "url": "http://www.dnd5eapi.co/api/equipment/53" + }, + { + "index": 54, + "name": "Arrow", + "equipment_category": "Adventuring Gear", + "gear_category": "Ammunition", + "cost": { + "quantity": 5, + "unit": "cp" + }, + "weight": 1, + "url": "http://www.dnd5eapi.co/api/equipment/54" + }, + { + "index": 55, + "name": "Blowgun needle", + "equipment_category": "Adventuring Gear", + "gear_category": "Ammunition", + "cost": { + "quantity": 2, + "unit": "cp" + }, + "weight": 1, + "url": "http://www.dnd5eapi.co/api/equipment/55" + }, + { + "index": 56, + "name": "Crossbow bolt", + "equipment_category": "Adventuring Gear", + "gear_category": "Ammunition", + "cost": { + "quantity": 5, + "unit": "cp" + }, + "weight": 1.5, + "url": "http://www.dnd5eapi.co/api/equipment/56" + }, + { + "index": 57, + "name": "Sling bullet", + "equipment_category": "Adventuring Gear", + "gear_category": "Ammunition", + "cost": { + "quantity": 1, + "unit": "cp" + }, + "weight": 1.5, + "url": "http://www.dnd5eapi.co/api/equipment/57" + }, + { + "index": 58, + "name": "Amulet", + "equipment_category": "Adventuring Gear", + "gear_category": "Holy Symbol", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic.", + "Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield." + ], + "url": "http://www.dnd5eapi.co/api/equipment/58" + }, + { + "index": 59, + "name": "Antitoxin (vial)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 50, + "unit": "gp" + }, + "weight": 0, + "desc": [ + "A creature that drinks this vial of liquid gains advantage on saving throws against poison for 1 hour. It confers no benefit to undead or constructs." + ], + "url": "http://www.dnd5eapi.co/api/equipment/59" + }, + { + "index": 60, + "name": "Crystal", + "equipment_category": "Adventuring Gear", + "gear_category": "Arcane focus", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus." + ], + "url": "http://www.dnd5eapi.co/api/equipment/60" + }, + { + "index": 61, + "name": "Orb", + "equipment_category": "Adventuring Gear", + "gear_category": "Arcane focus", + "cost": { + "quantity": 20, + "unit": "gp" + }, + "weight": 3, + "desc": [ + "An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus." + ], + "url": "http://www.dnd5eapi.co/api/equipment/61" + }, + { + "index": 62, + "name": "Rod", + "equipment_category": "Adventuring Gear", + "gear_category": "Arcane focus", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus." + ], + "url": "http://www.dnd5eapi.co/api/equipment/62" + }, + { + "index": 63, + "name": "Staff", + "equipment_category": "Adventuring Gear", + "gear_category": "Arcane focus", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 4, + "desc": [ + "An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus." + ], + "url": "http://www.dnd5eapi.co/api/equipment/63" + }, + { + "index": 64, + "name": "Wand", + "equipment_category": "Adventuring Gear", + "gear_category": "Arcane focus", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus." + ], + "url": "http://www.dnd5eapi.co/api/equipment/64" + }, + { + "index": 65, + "name": "Backpack", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 5, + "url": "http://www.dnd5eapi.co/api/equipment/65" + }, + { + "index": 66, + "name": "Ball bearings (bag of 1,000)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "As an action, you can spill these tiny metal balls from their pouch to cover a level, square area that is 10 feet on a side.", + "A creature moving across the covered area must succeed on a DC 10 Dexterity saving throw or fall prone.", + "A creature moving through the area at half speed doesn't need to make the save." + ], + "url": "http://www.dnd5eapi.co/api/equipment/66" + }, + { + "index": 67, + "name": "Barrel", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 70, + "url": "http://www.dnd5eapi.co/api/equipment/67" + }, + { + "index": 68, + "name": "Basket", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 4, + "unit": "sp" + }, + "weight": 2, + "url": "http://www.dnd5eapi.co/api/equipment/68" + }, + { + "index": 69, + "name": "Bedroll", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 7, + "url": "http://www.dnd5eapi.co/api/equipment/69" + }, + { + "index": 70, + "name": "Bell", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/70" + }, + { + "index": 71, + "name": "Blanket", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "sp" + }, + "weight": 3, + "url": "http://www.dnd5eapi.co/api/equipment/71" + }, + { + "index": 72, + "name": "Block and tackle", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "A set of pulleys with a cable threaded through them and a hook to attach to objects, a block and tackle allows you to hoist up to four times the weight you can normally lift." + ], + "url": "http://www.dnd5eapi.co/api/equipment/72" + }, + { + "index": 73, + "name": "Book", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "A book might contain poetry, historical accounts, information pertaining to a particular field of lore, diagrams and notes on gnomish contraptions, or just about anything else that can be represented using text or pictures. A book of spells is a spellbook (described later in this section)." + ], + "url": "http://www.dnd5eapi.co/api/equipment/73" + }, + { + "index": 74, + "name": "Bottle, glass", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 2, + "url": "http://www.dnd5eapi.co/api/equipment/74" + }, + { + "index": 75, + "name": "Bucket", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "cp" + }, + "weight": 2, + "url": "http://www.dnd5eapi.co/api/equipment/75" + }, + { + "index": 76, + "name": "Caltrops", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "cp" + }, + "weight": 2, + "desc": [ + "As an action, you can spread a bag of caltrops to cover a square area that is 5 feet on a side.", + "Any creature that enters the area must succeed on a DC 15 Dexterity saving throw or stop moving this turn and take 1 piercing damage.", + "Taking this damage reduces the creature's walking speed by 10 feet until the creature regains at least 1 hit point.", + "A creature moving through the area at half speed doesn't need to make the save." + ], + "url": "http://www.dnd5eapi.co/api/equipment/76" + }, + { + "index": 77, + "name": "Candle", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "cp" + }, + "weight": 0, + "desc": [ + "For 1 hour, a candle sheds bright light in a 5-foot radius and dim light for an additional 5 feet." + ], + "url": "http://www.dnd5eapi.co/api/equipment/77" + }, + { + "index": 78, + "name": "Case, crossbow bolt", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 1, + "desc": [ "This wooden case can hold up to twenty crossbow bolts." ], + "url": "http://www.dnd5eapi.co/api/equipment/78" + }, + { + "index": 79, + "name": "Case, map or scroll", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "This cylindrical leather case can hold up to ten rolled-up sheets of paper or five rolled-up sheets of parchment." + ], + "url": "http://www.dnd5eapi.co/api/equipment/79" + }, + { + "index": 80, + "name": "Chain (10 feet)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 10, + "desc": [ + "A chain has 10 hit points. It can be burst with a successful DC 20 Strength check." + ], + "url": "http://www.dnd5eapi.co/api/equipment/80" + }, + { + "index": 81, + "name": "Chalk (1 piece)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "cp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/81" + }, + { + "index": 82, + "name": "Chest", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 25, + "url": "http://www.dnd5eapi.co/api/equipment/82" + }, + { + "index": 83, + "name": "Clothes, common", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "sp" + }, + "weight": 3, + "url": "http://www.dnd5eapi.co/api/equipment/83" + }, + { + "index": 84, + "name": "Clothes, costume", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 4, + "url": "http://www.dnd5eapi.co/api/equipment/84" + }, + { + "index": 85, + "name": "Clothes, fine", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 15, + "unit": "gp" + }, + "weight": 6, + "url": "http://www.dnd5eapi.co/api/equipment/85" + }, + { + "index": 86, + "name": "Clothes, traveler's", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 4, + "url": "http://www.dnd5eapi.co/api/equipment/86" + }, + { + "index": 87, + "name": "Component pouch", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "weight": 2, + "desc": [ + " A component pouch is a small, watertight leather belt pouch that has compartments to hold all the material components and other special items you need to cast your spells, except for those components that have a specific cost (as indicated in a spell's description)." + ], + "url": "http://www.dnd5eapi.co/api/equipment/87" + }, + { + "index": 88, + "name": "Crowbar", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "Using a crowbar grants advantage to Strength checks where the crowbar's leverage can be applied." + ], + "url": "http://www.dnd5eapi.co/api/equipment/88" + }, + { + "index": 89, + "name": "Sprig of mistletoe", + "equipment_category": "Adventuring Gear", + "gear_category": "Druidic focus", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 0, + "desc": [ + "A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus." + ], + "url": "http://www.dnd5eapi.co/api/equipment/89" + }, + { + "index": 90, + "name": "Totem", + "equipment_category": "Adventuring Gear", + "gear_category": "Druidic focus", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 0, + "desc": [ + "A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus." + ], + "url": "http://www.dnd5eapi.co/api/equipment/90" + }, + { + "index": 91, + "name": "Wooden staff", + "equipment_category": "Adventuring Gear", + "gear_category": "Druidic focus", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 4, + "desc": [ + "A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus." + ], + "url": "http://www.dnd5eapi.co/api/equipment/91" + }, + { + "index": 92, + "name": "Yew wand", + "equipment_category": "Adventuring Gear", + "gear_category": "Druidic focus", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus." + ], + "url": "http://www.dnd5eapi.co/api/equipment/92" + }, + { + "index": 93, + "name": "Emblem", + "equipment_category": "Adventuring Gear", + "gear_category": "Holy Symbol", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 0, + "desc": [ + "A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic.", + "Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield." + ], + "url": "http://www.dnd5eapi.co/api/equipment/93" + }, + { + "index": 94, + "name": "Fishing tackle", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 4, + "desc": [ + "This kit includes a wooden rod, silken line, corkwood bobbers, steel hooks, lead sinkers, velvet lures, and narrow netting." + ], + "url": "http://www.dnd5eapi.co/api/equipment/94" + }, + { + "index": 95, + "name": "Flask or tankard", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "cp" + }, + "weight": 1, + "url": "http://www.dnd5eapi.co/api/equipment/95" + }, + { + "index": 96, + "name": "Grappling hook", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 4, + "url": "http://www.dnd5eapi.co/api/equipment/96" + }, + { + "index": 97, + "name": "Hammer", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 3, + "url": "http://www.dnd5eapi.co/api/equipment/97" + }, + { + "index": 98, + "name": "Hammer, sledge", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 10, + "url": "http://www.dnd5eapi.co/api/equipment/98" + }, + { + "index": 99, + "name": "Holy water (flask)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "As an action, you can splash the contents of this flask onto a creature within 5 feet of you or throw it up to 20 feet, shattering it on impact. In either case, make a ranged attack against a target creature, treating the holy water as an improvised weapon.", + "If the target is a fiend or undead, it takes 2d6 radiant damage.", + "A cleric or paladin may create holy water by performing a special ritual.", + "The ritual takes 1 hour to perform, uses 25 gp worth of powdered silver, and requires the caster to expend a 1st-level spell slot." + ], + "url": "http://www.dnd5eapi.co/api/equipment/99" + }, + { + "index": 100, + "name": "Hourglass", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "weight": 1, + "url": "http://www.dnd5eapi.co/api/equipment/100" + }, + { + "index": 101, + "name": "Hunting trap", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "desc": [ + "When you use your action to set it, this trap forms a saw-toothed steel ring that snaps shut when a creature steps on a pressure plate in the center. The trap is affixed by a heavy chain to an immobile object, such as a tree or a spike driven into the ground.", + "A creature that steps on the plate must succeed on a DC 13 Dexterity saving throw or take 1d4 piercing damage and stop moving. Thereafter, until the creature breaks free of the trap, its movement is limited by the length of the chain (typically 3 feet long).", + "A creature can use its action to make a DC 13 Strength check, freeing itself or another creature within its reach on a success. Each failed check deals 1 piercing damage to the trapped creature." + ], + "weight": 25, + "url": "http://www.dnd5eapi.co/api/equipment/101" + }, + { + "index": 102, + "name": "Ink (1 ounce bottle)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/102" + }, + { + "index": 103, + "name": "Ink pen", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "cp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/103" + }, + { + "index": 104, + "name": "Jug or pitcher", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "cp" + }, + "weight": 4, + "url": "http://www.dnd5eapi.co/api/equipment/104" + }, + { + "index": 105, + "name": "Climber's Kit", + "equipment_category": "Adventuring Gear", + "gear_category": "Kit", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "weight": 12, + "desc": [ + "A climber's kit includes special pitons, boot tips, gloves, and a harness. You can use the climber's kit as an action to anchor yourself; when you do, you can't fall more than 25 feet from the point where you anchored yourself, and you can't climb more than 25 feet away from that point without undoing the anchor." + ], + "url": "http://www.dnd5eapi.co/api/equipment/105" + }, + { + "index": 106, + "name": "Disguise Kit", + "equipment_category": "Adventuring Gear", + "gear_category": "Kit", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "weight": 3, + "desc": [ + "This pouch of cosmetics, hair dye, and small props lets you create disguises that change your physical appearance. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to create a visual disguise." + ], + "url": "http://www.dnd5eapi.co/api/equipment/106" + }, + { + "index": 107, + "name": "Forgery Kit", + "equipment_category": "Adventuring Gear", + "gear_category": "Kit", + "cost": { + "quantity": 15, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "This small box contains a variety of papers and parchments, pens and inks, seals and sealing wax, gold and silver leaf, and other supplies necessary to create convincing forgeries of physical documents. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to create a physical forgery of a document." + ], + "url": "http://www.dnd5eapi.co/api/equipment/107" + }, + { + "index": 108, + "name": "Herbalism Kit", + "equipment_category": "Adventuring Gear", + "gear_category": "Kit", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 3, + "desc": [ + "This kit contains a variety of instruments such as clippers, mortar and pestle, and pouches and vials used by herbalists to create remedies and potions. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to identify or apply herbs. Also, proficiency with this kit is required to create antitoxin and potions of healing." + ], + "url": "http://www.dnd5eapi.co/api/equipment/108" + }, + { + "index": 109, + "name": "Healer's Kit", + "equipment_category": "Adventuring Gear", + "gear_category": "Kit", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 3, + "desc": [ + "This kit is a leather pouch containing bandages, salves, and splints. The kit has ten uses. As an action, you can expend one use of the kit to stabilize a creature that has 0 hit points, without needing to make a Wisdom (Medicine) check." + ], + "url": "http://www.dnd5eapi.co/api/equipment/109" + }, + { + "index": 110, + "name": "Mess Kit", + "equipment_category": "Adventuring Gear", + "gear_category": "Kit", + "cost": { + "quantity": 2, + "unit": "sp" + }, + "weight": 1, + "desc": [ + "This tin box contains a cup and simple cutlery. The box clamps together, and one side can be used as a cooking pan and the other as a plate or shallow bowl." + ], + "url": "http://www.dnd5eapi.co/api/equipment/110" + }, + { + "index": 111, + "name": "Poisoner's Kit", + "equipment_category": "Adventuring Gear", + "gear_category": "Kit", + "cost": { + "quantity": 50, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "A poisoner's kit includes the vials, chemicals, and other equipment necessary for the creation of poisons. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to craft or use poisons." + ], + "url": "http://www.dnd5eapi.co/api/equipment/111" + }, + { + "index": 112, + "name": "Ladder (10-foot)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "sp" + }, + "weight": 25, + "url": "http://www.dnd5eapi.co/api/equipment/112" + }, + { + "index": 113, + "name": "Lamp", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "sp" + }, + "weight": 1, + "desc": [ + "A lamp casts bright light in a 15-foot radius and dim light for an additional 30 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil." + ], + "url": "http://www.dnd5eapi.co/api/equipment/113" + }, + { + "index": 114, + "name": "Lantern, bullseye", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "A bullseye lantern casts bright light in a 60-foot cone and dim light for an additional 60 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil." + ], + "url": "http://www.dnd5eapi.co/api/equipment/114" + }, + { + "index": 115, + "name": "Lantern, hooded", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "A hooded lantern casts bright light in a 30-foot radius and dim light for an additional 30 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil. As an action, you can lower the hood, reducing the light to dim light in a 5-foot radius." + ], + "url": "http://www.dnd5eapi.co/api/equipment/115" + }, + { + "index": 116, + "name": "Lock", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "A key is provided with the lock. Without the key, a creature proficient with thieves' tools can pick this lock with a successful DC 15 Dexterity check. Your GM may decide that better locks are available for higher prices." + ], + "url": "http://www.dnd5eapi.co/api/equipment/116" + }, + { + "index": 117, + "name": "Magnifying glass", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 100, + "unit": "gp" + }, + "weight": 0, + "desc": [ + "This lens allows a closer look at small objects. It is also useful as a substitute for flint and steel when starting fires. Lighting a fire with a magnifying glass requires light as bright as sunlight to focus, tinder to ignite, and about 5 minutes for the fire to ignite.", + "A magnifying glass grants advantage on any ability check made to appraise or inspect an item that is small or highly detailed." + ], + "url": "http://www.dnd5eapi.co/api/equipment/117" + }, + { + "index": 118, + "name": "Manacles", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 6, + "desc": [ + "These metal restraints can bind a Small or Medium creature. Escaping the manacles requires a successful DC 20 Dexterity check. Breaking them requires a successful DC 20 Strength check.", + "Each set of manacles comes with one key. Without the key, a creature proficient with thieves' tools can pick the manacles' lock with a successful DC 15 Dexterity check. Manacles have 15 hit points." + ], + "url": "http://www.dnd5eapi.co/api/equipment/118" + }, + { + "index": 119, + "name": "Mirror, steel", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 0.5, + "url": "http://www.dnd5eapi.co/api/equipment/119" + }, + { + "index": 120, + "name": "Oil (flask)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "sp" + }, + "weight": 1, + "desc": [ + "Oil usually comes in a clay flask that holds 1 pint.", + "As an action, you can splash the oil in this flask onto a creature within 5 feet of you or throw it up to 20 feet, shattering it on impact. Make a ranged attack against a target creature or object, treating the oil as an improvised weapon.", + "On a hit, the target is covered in oil. If the target takes any fire damage before the oil dries (after 1 minute), the target takes an additional 5 fire damage from the burning oil.", + "You can also pour a flask of oil on the ground to cover a 5-foot-square area, provided that the surface is level.", + "If lit, the oil burns for 2 rounds and deals 5 fire damage to any creature that enters the area or ends its turn in the area. A creature can take this damage only once per turn." + ], + "url": "http://www.dnd5eapi.co/api/equipment/120" + }, + { + "index": 121, + "name": "Paper (one sheet)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "sp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/121" + }, + { + "index": 122, + "name": "Parchment (one sheet)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "sp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/122" + }, + { + "index": 123, + "name": "Perfume (vial)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/123" + }, + { + "index": 124, + "name": "Pick, miner's", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 10, + "url": "http://www.dnd5eapi.co/api/equipment/124" + }, + { + "index": 125, + "name": "Piton", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "cp" + }, + "weight": 0.25, + "url": "http://www.dnd5eapi.co/api/equipment/125" + }, + { + "index": 126, + "name": "Poison, basic (vial)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 100, + "unit": "gp" + }, + "weight": 0, + "desc": [ + "You can use the poison in this vial to coat one slashing or piercing weapon or up to three pieces of ammunition. Applying the poison takes an action. A creature hit by the poisoned weapon or ammunition must make a DC 10 Constitution saving throw or take 1d4 poison damage. Once applied, the poison retains potency for 1 minute before drying." + ], + "url": "http://www.dnd5eapi.co/api/equipment/126" + }, + { + "index": 127, + "name": "Pole (10-foot)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "cp" + }, + "weight": 7, + "url": "http://www.dnd5eapi.co/api/equipment/127" + }, + { + "index": 128, + "name": "Pot, iron", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 10, + "url": "http://www.dnd5eapi.co/api/equipment/128" + }, + { + "index": 129, + "name": "Potion of healing", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 50, + "unit": "gp" + }, + "weight": 0.5, + "desc": [ + "A character who drinks the magical red fluid in this vial regains 2d4 + 2 hit points. Drinking or administering a potion takes an action." + ], + "url": "http://www.dnd5eapi.co/api/equipment/129" + }, + { + "index": 130, + "name": "Pouch", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "sp" + }, + "weight": 1, + "desc": [ + "A cloth or leather pouch can hold up to 20 sling bullets or 50 blowgun needles, among other things. A compartmentalized pouch for holding spell components is called a component pouch (described earlier in this section)." + ], + "url": "http://www.dnd5eapi.co/api/equipment/130" + }, + { + "index": 131, + "name": "Quiver", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 1, + "desc": [ "A quiver can hold up to 20 arrows." ], + "url": "http://www.dnd5eapi.co/api/equipment/131" + }, + { + "index": 132, + "name": "Ram, portable", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 4, + "unit": "gp" + }, + "weight": 35, + "desc": [ + "You can use a portable ram to break down doors. When doing so, you gain a +4 bonus on the Strength check. One other character can help you use the ram, giving you advantage on this check." + ], + "url": "http://www.dnd5eapi.co/api/equipment/132" + }, + { + "index": 133, + "name": "Rations (1 day)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "sp" + }, + "weight": 2, + "desc": [ + "Rations consist of dry foods suitable for extended travel, including jerky, dried fruit, hardtack, and nuts." + ], + "url": "http://www.dnd5eapi.co/api/equipment/133" + }, + { + "index": 134, + "name": "Reliquary", + "equipment_category": "Adventuring Gear", + "gear_category": "Holy Symbol", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic.", + "Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield." + ], + "url": "http://www.dnd5eapi.co/api/equipment/134" + }, + { + "index": 135, + "name": "Robes", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 4, + "url": "http://www.dnd5eapi.co/api/equipment/135" + }, + { + "index": 136, + "name": "Rope, hempen (50 feet)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 10, + "desc": [ + "Rope, whether made of hemp or silk, has 2 hit points and can be burst with a DC 17 Strength check." + ], + "url": "http://www.dnd5eapi.co/api/equipment/136" + }, + { + "index": 137, + "name": "Rope, silk (50 feet)", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "Rope, whether made of hemp or silk, has 2 hit points and can be burst with a DC 17 Strength check." + ], + "url": "http://www.dnd5eapi.co/api/equipment/137" + }, + { + "index": 138, + "name": "Sack", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "cp" + }, + "weight": 0.5, + "url": "http://www.dnd5eapi.co/api/equipment/138" + }, + { + "index": 139, + "name": "Scale, merchant's", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 3, + "desc": [ + "A scale includes a small balance, pans, and a suitable assortment of weights up to 2 pounds. With it, you can measure the exact weight of small objects, such as raw precious metals or trade goods, to help determine their worth." + ], + "url": "http://www.dnd5eapi.co/api/equipment/139" + }, + { + "index": 140, + "name": "Sealing wax", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "sp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/140" + }, + { + "index": 141, + "name": "Shovel", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 5, + "url": "http://www.dnd5eapi.co/api/equipment/141" + }, + { + "index": 142, + "name": "Signal whistle", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "cp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/142" + }, + { + "index": 143, + "name": "Signet ring", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/143" + }, + { + "index": 144, + "name": "Soap", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "cp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/144" + }, + { + "index": 145, + "name": "Spellbook", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 50, + "unit": "gp" + }, + "weight": 3, + "desc": [ + "Essential for wizards, a spellbook is a leather-bound tome with 100 blank vellum pages suitable for recording spells." + ], + "url": "http://www.dnd5eapi.co/api/equipment/145" + }, + { + "index": 146, + "name": "Spike, iron", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "sp" + }, + "weight": 5, + "url": "http://www.dnd5eapi.co/api/equipment/146" + }, + { + "index": 147, + "name": "Spyglass", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1000, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "Objects viewed through a spyglass are magnified to twice their size." + ], + "url": "http://www.dnd5eapi.co/api/equipment/147" + }, + { + "index": 148, + "name": "Tent, two-person", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 20, + "desc": [ "A simple and portable canvas shelter, a tent sleeps two." ], + "url": "http://www.dnd5eapi.co/api/equipment/148" + }, + { + "index": 149, + "name": "Tinderbox", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 5, + "unit": "sp" + }, + "weight": 1, + "desc": [ + "This small container holds flint, fire steel, and tinder (usually dry cloth soaked in light oil) used to kindle a fire. Using it to light a torch--or anything else with abundant, exposed fuel--takes an action.", + "Lighting any other fire takes 1 minute." + ], + "url": "http://www.dnd5eapi.co/api/equipment/149" + }, + { + "index": 150, + "name": "Torch", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "cp" + }, + "weight": 1, + "desc": [ + "A torch burns for 1 hour, providing bright light in a 20-foot radius and dim light for an additional 20 feet. If you make a melee attack with a burning torch and hit, it deals 1 fire damage." + ], + "url": "http://www.dnd5eapi.co/api/equipment/150" + }, + { + "index": 151, + "name": "Vial", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 0, + "url": "http://www.dnd5eapi.co/api/equipment/151" + }, + { + "index": 152, + "name": "Waterskin", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 2, + "unit": "sp" + }, + "weight": 5, + "url": "http://www.dnd5eapi.co/api/equipment/152" + }, + { + "index": 153, + "name": "Whetstone", + "equipment_category": "Adventuring Gear", + "gear_category": "Standard Gear", + "cost": { + "quantity": 1, + "unit": "cp" + }, + "weight": 1, + "url": "http://www.dnd5eapi.co/api/equipment/153" + }, + { + "index": 154, + "name": "Burglar's Pack", + "equipment_category": "Adventuring Gear", + "gear_category": "Equipment Pack", + "cost": { + "quantity": 16, + "unit": "gp" + } + }, + { + "index": 161, + "name": "Alchemist's supplies", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 50, + "unit": "gp" + }, + "weight": 8, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/161" + }, + { + "index": 162, + "name": "Brewer's supplies", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 20, + "unit": "gp" + }, + "weight": 9, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/162" + }, + { + "index": 163, + "name": "Calligrapher's supplies", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/163" + }, + { + "index": 164, + "name": "Carpenter's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 8, + "unit": "gp" + }, + "weight": 6, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/164" + }, + { + "index": 165, + "name": "Cartographer's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 15, + "unit": "gp" + }, + "weight": 6, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/165" + }, + { + "index": 166, + "name": "Cobbler's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/166" + }, + { + "index": 167, + "name": "Cook's utensils", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 8, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/167" + }, + { + "index": 168, + "name": "Glassblower's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 30, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/168" + }, + { + "index": 169, + "name": "Jeweler's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/169" + }, + { + "index": 170, + "name": "Leatherworker's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/170" + }, + { + "index": 171, + "name": "Mason's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 8, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/171" + }, + { + "index": 172, + "name": "Painter's supplies", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/172" + }, + { + "index": 173, + "name": "Potter's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "weight": 3, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/173" + }, + { + "index": 174, + "name": "Smith's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 20, + "unit": "gp" + }, + "weight": 8, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/174" + }, + { + "index": 175, + "name": "Tinker's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 50, + "unit": "gp" + }, + "weight": 10, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/175" + }, + { + "index": 176, + "name": "Weaver's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/176" + }, + { + "index": 177, + "name": "Woodcarver's tools", + "equipment_category": "Tools", + "tool_category": "Artisan's Tools", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "weight": 5, + "desc": [ + "These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/177" + }, + { + "index": 178, + "name": "Dice set", + "equipment_category": "Tools", + "tool_category": "Gaming Sets", + "cost": { + "quantity": 1, + "unit": "sp" + }, + "weight": 0, + "desc": [ + "This item encompasses a wide range of game pieces, including dice and decks of cards (for games such as Three-Dragon Ante). A few common examples appear on the Tools table, but other kinds of gaming sets exist. If you are proficient with a gaming set, you can add your proficiency bonus to ability checks you make to play a game with that set. Each type of gaming set requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/178" + }, + { + "index": 179, + "name": "Playing card set", + "equipment_category": "Tools", + "tool_category": "Gaming Sets", + "cost": { + "quantity": 5, + "unit": "sp" + }, + "weight": 0, + "desc": [ + "This item encompasses a wide range of game pieces, including dice and decks of cards (for games such as Three-Dragon Ante). A few common examples appear on the Tools table, but other kinds of gaming sets exist. If you are proficient with a gaming set, you can add your proficiency bonus to ability checks you make to play a game with that set. Each type of gaming set requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/179" + }, + { + "index": 180, + "name": "Bagpipes", + "equipment_category": "Tools", + "tool_category": "Musical Instrument", + "cost": { + "quantity": 30, + "unit": "gp" + }, + "weight": 6, + "desc": [ + "Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/180" + }, + { + "index": 181, + "name": "Drum", + "equipment_category": "Tools", + "tool_category": "Musical Instrument", + "cost": { + "quantity": 6, + "unit": "gp" + }, + "weight": 3, + "desc": [ + "Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/181" + }, + { + "index": 182, + "name": "Dulcimer", + "equipment_category": "Tools", + "tool_category": "Musical Instrument", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "weight": 10, + "desc": [ + "Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/182" + }, + { + "index": 183, + "name": "Flute", + "equipment_category": "Tools", + "tool_category": "Musical Instrument", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/183" + }, + { + "index": 184, + "name": "Lute", + "equipment_category": "Tools", + "tool_category": "Musical Instrument", + "cost": { + "quantity": 35, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/184" + }, + { + "index": 185, + "name": "Lyre", + "equipment_category": "Tools", + "tool_category": "Musical Instrument", + "cost": { + "quantity": 30, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/185" + }, + { + "index": 186, + "name": "Horn", + "equipment_category": "Tools", + "tool_category": "Musical Instrument", + "cost": { + "quantity": 3, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/186" + }, + { + "index": 187, + "name": "Pan flute", + "equipment_category": "Tools", + "tool_category": "Musical Instrument", + "cost": { + "quantity": 12, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/187" + }, + { + "index": 188, + "name": "Shawm", + "equipment_category": "Tools", + "tool_category": "Musical Instrument", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/188" + }, + { + "index": 189, + "name": "Viol", + "equipment_category": "Tools", + "tool_category": "Musical Instrument", + "cost": { + "quantity": 30, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency." + ], + "url": "http://www.dnd5eapi.co/api/equipment/189" + }, + { + "index": 190, + "name": "Navigator's tools", + "equipment_category": "Tools", + "tool_category": "Other Tools", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "weight": 2, + "desc": [ + "This set of instruments is used for navigation at sea. Proficiency with navigator's tools lets you chart a ship's course and follow navigation charts. In addition, these tools allow you to add your proficiency bonus to any ability check you make to avoid getting lost at sea." + ], + "url": "http://www.dnd5eapi.co/api/equipment/190" + }, + { + "index": 191, + "name": "Thieves' tools", + "equipment_category": "Tools", + "tool_category": "Other Tools", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "weight": 1, + "desc": [ + "This set of tools includes a small file, a set of lock picks, a small mirror mounted on a metal handle, a set of narrow-bladed scissors, and a pair of pliers. Proficiency with these tools lets you add your proficiency bonus to any ability checks you make to disarm traps or open locks." + ], + "url": "http://www.dnd5eapi.co/api/equipment/191" + } +] diff --git a/SessionCompanion/SessionCompanion.Database/JsonData/weapons.json b/SessionCompanion/SessionCompanion.Database/JsonData/weapons.json new file mode 100644 index 0000000..b0caae9 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/JsonData/weapons.json @@ -0,0 +1,1450 @@ +[ + { + "_id": "5bce91275b7768e792017da3", + "index": 1, + "name": "Club", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Melee", + "category_range": "Simple Melee", + "cost": { + "quantity": 1, + "unit": "sp" + }, + "damage": { + "dice_count": 1, + "dice_value": 4, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/2", + "name": "Bludgeoning" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [ + { + "name": "Light", + "url": "http://www.dnd5eapi.co/api/weapon-properties/4" + }, + { + "name": "Monk", + "url": "http://www.dnd5eapi.co/api/weapon-properties/11" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/1" + }, + { + "_id": "5bce91275b7768e792017da1", + "index": 2, + "name": "Dagger", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Melee", + "category_range": "Simple Melee", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 4, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 1, + "properties": [ + { + "name": "Finesse", + "url": "http://www.dnd5eapi.co/api/weapon-properties/2" + }, + { + "name": "Light", + "url": "http://www.dnd5eapi.co/api/weapon-properties/4" + }, + { + "name": "Thrown", + "url": "http://www.dnd5eapi.co/api/weapon-properties/8" + }, + { + "name": "Monk", + "url": "http://www.dnd5eapi.co/api/weapon-properties/11" + } + ], + "throw_range": { + "normal": 20, + "_long": 60 + }, + "url": "http://www.dnd5eapi.co/api/equipment/2" + }, + { + "_id": "5bce91275b7768e792017db1", + "index": 3, + "name": "Greatclub", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Melee", + "category_range": "Simple Melee", + "cost": { + "quantity": 2, + "unit": "sp" + }, + "damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/2", + "name": "Bludgeoning" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 10, + "properties": [ + { + "name": "Two-Handed", + "url": "http://www.dnd5eapi.co/api/weapon-properties/9" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/3" + }, + { + "_id": "5bce91275b7768e792017da6", + "index": 4, + "name": "Handaxe", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Melee", + "category_range": "Simple Melee", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 6, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [ + { + "name": "Light", + "url": "http://www.dnd5eapi.co/api/weapon-properties/4" + }, + { + "name": "Thrown", + "url": "http://www.dnd5eapi.co/api/weapon-properties/8" + }, + { + "name": "Monk", + "url": "http://www.dnd5eapi.co/api/weapon-properties/11" + } + ], + "throw_range": { + "normal": 20, + "_long": 60 + }, + "url": "http://www.dnd5eapi.co/api/equipment/4" + }, + { + "_id": "5bce91275b7768e792017da2", + "index": 5, + "name": "Javelin", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Melee", + "category_range": "Simple Melee", + "cost": { + "quantity": 5, + "unit": "sp" + }, + "damage": { + "dice_count": 1, + "dice_value": 6, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [ + { + "name": "Thrown", + "url": "http://www.dnd5eapi.co/api/weapon-properties/8" + }, + { + "name": "Monk", + "url": "http://www.dnd5eapi.co/api/weapon-properties/11" + } + ], + "throw_range": { + "normal": 30, + "_long": 120 + }, + "url": "http://www.dnd5eapi.co/api/equipment/5" + }, + { + "_id": "5bce91275b7768e792017da4", + "index": 6, + "name": "Light hammer", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Melee", + "category_range": "Simple Melee", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 4, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/2", + "name": "Bludgeoning" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [ + { + "name": "Light", + "url": "http://www.dnd5eapi.co/api/weapon-properties/4" + }, + { + "name": "Thrown", + "url": "http://www.dnd5eapi.co/api/weapon-properties/8" + }, + { + "name": "Monk", + "url": "http://www.dnd5eapi.co/api/weapon-properties/11" + } + ], + "throw_range": { + "normal": 20, + "_long": 60 + }, + "url": "http://www.dnd5eapi.co/api/equipment/6" + }, + { + "_id": "5bce91275b7768e792017da5", + "index": 7, + "name": "Mace", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Melee", + "category_range": "Simple Melee", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 6, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/2", + "name": "Bludgeoning" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 4, + "properties": [ + { + "name": "Monk", + "url": "http://www.dnd5eapi.co/api/weapon-properties/11" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/7" + }, + { + "_id": "5bce91275b7768e792017da8", + "index": 8, + "name": "Quarterstaff", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Melee", + "category_range": "Simple Melee", + "cost": { + "quantity": 2, + "unit": "sp" + }, + "damage": { + "dice_count": 1, + "dice_value": 6, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/2", + "name": "Bludgeoning" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 4, + "properties": [ + { + "name": "Versatile", + "url": "http://www.dnd5eapi.co/api/weapon-properties/10" + }, + { + "name": "Monk", + "url": "http://www.dnd5eapi.co/api/weapon-properties/11" + } + ], + "two_hand_damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/2", + "name": "Bludgeoning" + } + }, + "url": "http://www.dnd5eapi.co/api/equipment/8" + }, + { + "_id": "5bce91275b7768e792017da7", + "index": 9, + "name": "Sickle", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Melee", + "category_range": "Simple Melee", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 4, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [ + { + "name": "Light", + "url": "http://www.dnd5eapi.co/api/weapon-properties/4" + }, + { + "name": "Monk", + "url": "http://www.dnd5eapi.co/api/weapon-properties/11" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/9" + }, + { + "_id": "5bce91275b7768e792017da9", + "index": 10, + "name": "Spear", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Melee", + "category_range": "Simple Melee", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 4, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 3, + "properties": [ + { + "name": "Thrown", + "url": "http://www.dnd5eapi.co/api/weapon-properties/8" + }, + { + "name": "Versatile", + "url": "http://www.dnd5eapi.co/api/weapon-properties/10" + }, + { + "name": "Monk", + "url": "http://www.dnd5eapi.co/api/weapon-properties/11" + } + ], + "throw_range": { + "normal": 20, + "_long": 60 + }, + "two_hand_damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "url": "http://www.dnd5eapi.co/api/equipment/10" + }, + { + "_id": "5bce91275b7768e792017db0", + "index": 11, + "name": "Crossbow, light", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Ranged", + "category_range": "Simple Ranged", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 5, + "properties": [ + { + "name": "Ammunition", + "url": "http://www.dnd5eapi.co/api/weapon-properties/1" + }, + { + "name": "Loading", + "url": "http://www.dnd5eapi.co/api/weapon-properties/5" + }, + { + "name": "Two-Handed", + "url": "http://www.dnd5eapi.co/api/weapon-properties/9" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/11" + }, + { + "_id": "5bce91275b7768e792017dab", + "index": 12, + "name": "Dart", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Ranged", + "category_range": "Simple Ranged", + "cost": { + "quantity": 5, + "unit": "cp" + }, + "damage": { + "dice_count": 1, + "dice_value": 4, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 0.25, + "properties": [ + { + "name": "Finesse", + "url": "http://www.dnd5eapi.co/api/weapon-properties/2" + }, + { + "name": "Thrown", + "url": "http://www.dnd5eapi.co/api/weapon-properties/8" + } + ], + "throw_range": { + "normal": 20, + "_long": 60 + }, + "url": "http://www.dnd5eapi.co/api/equipment/12" + }, + { + "_id": "5bce91275b7768e792017daa", + "index": 13, + "name": "Shortbow", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Ranged", + "category_range": "Simple Ranged", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 6, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [ + { + "name": "Ammunition", + "url": "http://www.dnd5eapi.co/api/weapon-properties/1" + }, + { + "name": "Two-Handed", + "url": "http://www.dnd5eapi.co/api/weapon-properties/9" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/13" + }, + { + "_id": "5bce91275b7768e792017dac", + "index": 14, + "name": "Sling", + "equipment_category": "Weapon", + "weapon_category:": "Simple", + "weapon_range": "Ranged", + "category_range": "Simple Ranged", + "cost": { + "quantity": 1, + "unit": "sp" + }, + "damage": { + "dice_count": 1, + "dice_value": 4, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/2", + "name": "Bludgeoning" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 0, + "properties": [ + { + "name": "Ammunition", + "url": "http://www.dnd5eapi.co/api/weapon-properties/1" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/14" + }, + { + "_id": "5bce91275b7768e792017dad", + "index": 15, + "name": "Battleaxe", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 4, + "properties": [ + { + "name": "Versatile", + "url": "http://www.dnd5eapi.co/api/weapon-properties/10" + } + ], + "two_hand_damage": { + "dice_count": 1, + "dice_value": 10, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "url": "http://www.dnd5eapi.co/api/equipment/15" + }, + { + "_id": "5bce91275b7768e792017dae", + "index": 16, + "name": "Flail", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/2", + "name": "Bludgeoning" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [], + "url": "http://www.dnd5eapi.co/api/equipment/16" + }, + { + "_id": "5bce91275b7768e792017daf", + "index": 17, + "name": "Glaive", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 20, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 10, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 6, + "properties": [ + { + "name": "Heavy", + "url": "http://www.dnd5eapi.co/api/weapon-properties/3" + }, + { + "name": "Reach", + "url": "http://www.dnd5eapi.co/api/weapon-properties/6" + }, + { + "name": "Two-Handed", + "url": "http://www.dnd5eapi.co/api/weapon-properties/9" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/17" + }, + { + "_id": "5bce91275b7768e792017db3", + "index": 18, + "name": "Greataxe", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 30, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 12, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 7, + "properties": [ + { + "name": "Heavy", + "url": "http://www.dnd5eapi.co/api/weapon-properties/3" + }, + { + "name": "Two-Handed", + "url": "http://www.dnd5eapi.co/api/weapon-properties/9" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/18" + }, + { + "_id": "5bce91275b7768e792017db2", + "index": 19, + "name": "Greatsword", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 50, + "unit": "gp" + }, + "damage": { + "dice_count": 2, + "dice_value": 6, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 6, + "properties": [ + { + "name": "Heavy", + "url": "http://www.dnd5eapi.co/api/weapon-properties/3" + }, + { + "name": "Two-Handed", + "url": "http://www.dnd5eapi.co/api/weapon-properties/9" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/19" + }, + { + "_id": "5bce91275b7768e792017db4", + "index": 20, + "name": "Halberd", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 20, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 10, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 6, + "properties": [ + { + "name": "Heavy", + "url": "http://www.dnd5eapi.co/api/weapon-properties/3" + }, + { + "name": "Reach", + "url": "http://www.dnd5eapi.co/api/weapon-properties/6" + }, + { + "name": "Two-Handed", + "url": "http://www.dnd5eapi.co/api/weapon-properties/9" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/20" + }, + { + "_id": "5bce91275b7768e792017db5", + "index": 21, + "name": "Lance", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 12, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 6, + "properties": [ + { + "name": "Reach", + "url": "http://www.dnd5eapi.co/api/weapon-properties/6" + }, + { + "name": "Special", + "url": "http://www.dnd5eapi.co/api/weapon-properties/7" + } + ], + "special": [ + "You have disadvantage when you use a lance to attack a target within 5 feet of you. Also, a lance requires two hands to wield when you aren’t mounted." + ], + "url": "http://www.dnd5eapi.co/api/equipment/21" + }, + { + "_id": "5bce91275b7768e792017db6", + "index": 22, + "name": "Longsword", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 15, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 3, + "properties": [ + { + "name": "Versatile", + "url": "http://www.dnd5eapi.co/api/weapon-properties/10" + } + ], + "two_hand_damage": { + "dice_count": 1, + "dice_value": 10, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "url": "http://www.dnd5eapi.co/api/equipment/22" + }, + { + "_id": "5bce91275b7768e792017db7", + "index": 23, + "name": "Maul", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "damage": { + "dice_count": 2, + "dice_value": 6, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/2", + "name": "Bludgeoning" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 10, + "properties": [ + { + "name": "Heavy", + "url": "http://www.dnd5eapi.co/api/weapon-properties/3" + }, + { + "name": "Two-Handed", + "url": "http://www.dnd5eapi.co/api/weapon-properties/9" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/23" + }, + { + "_id": "5bce91275b7768e792017dc4", + "index": 24, + "name": "Morningstar", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 15, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 4, + "properties": [], + "url": "http://www.dnd5eapi.co/api/equipment/24" + }, + { + "_id": "5bce91275b7768e792017dbb", + "index": 25, + "name": "Pike", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 10, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 18, + "properties": [ + { + "name": "Heavy", + "url": "http://www.dnd5eapi.co/api/weapon-properties/3" + }, + { + "name": "Reach", + "url": "http://www.dnd5eapi.co/api/weapon-properties/6" + }, + { + "name": "Two-Handed", + "url": "http://www.dnd5eapi.co/api/weapon-properties/9" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/25" + }, + { + "_id": "5bce91275b7768e792017db8", + "index": 26, + "name": "Rapier", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [ + { + "name": "Finesse", + "url": "http://www.dnd5eapi.co/api/weapon-properties/2" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/26" + }, + { + "_id": "5bce91275b7768e792017db9", + "index": 27, + "name": "Scimitar", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 25, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 6, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 3, + "properties": [ + { + "name": "Finesse", + "url": "http://www.dnd5eapi.co/api/weapon-properties/2" + }, + { + "name": "Light", + "url": "http://www.dnd5eapi.co/api/weapon-properties/4" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/27" + }, + { + "_id": "5bce91275b7768e792017dba", + "index": 28, + "name": "Shortsword", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 6, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [ + { + "name": "Finesse", + "url": "http://www.dnd5eapi.co/api/weapon-properties/2" + }, + { + "name": "Light", + "url": "http://www.dnd5eapi.co/api/weapon-properties/4" + }, + { + "name": "Monk", + "url": "http://www.dnd5eapi.co/api/weapon-properties/11" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/28" + }, + { + "_id": "5bce91275b7768e792017dbc", + "index": 29, + "name": "Trident", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 6, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 4, + "properties": [ + { + "name": "Thrown", + "url": "http://www.dnd5eapi.co/api/weapon-properties/8" + }, + { + "name": "Versatile", + "url": "http://www.dnd5eapi.co/api/weapon-properties/10" + } + ], + "throw_range": { + "normal": 20, + "_long": 60 + }, + "url": "http://www.dnd5eapi.co/api/equipment/29" + }, + { + "_id": "5bce91275b7768e792017dbd", + "index": 30, + "name": "War pick", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 5, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [], + "url": "http://www.dnd5eapi.co/api/equipment/30" + }, + { + "_id": "5bce91275b7768e792017dbe", + "index": 31, + "name": "Warhammer", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 15, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/2", + "name": "Bludgeoning" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [ + { + "name": "Versatile", + "url": "http://www.dnd5eapi.co/api/weapon-properties/10" + } + ], + "two_hand_damage": { + "dice_count": 1, + "dice_value": 10, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/2", + "name": "Bludgeoning" + } + }, + "url": "http://www.dnd5eapi.co/api/equipment/31" + }, + { + "_id": "5bce91275b7768e792017dbf", + "index": 32, + "name": "Whip", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Melee", + "category_range": "Martial Melee", + "cost": { + "quantity": 2, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 4, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 3, + "properties": [ + { + "name": "Finesse", + "url": "http://www.dnd5eapi.co/api/weapon-properties/2" + }, + { + "name": "Reach", + "url": "http://www.dnd5eapi.co/api/weapon-properties/6" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/32" + }, + { + "_id": "5bce91275b7768e792017dc7", + "index": 33, + "name": "Blowgun", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Ranged", + "category_range": "Martial Ranged", + "cost": { + "quantity": 10, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 1, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 1, + "properties": [ + { + "url": "http://www.dnd5eapi.co/api/weapon-properties/1", + "name": "Ammunition" + }, + { + "url": "http://www.dnd5eapi.co/api/weapon-properties/5", + "name": "Loading" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/33" + }, + { + "_id": "5bce91275b7768e792017dc0", + "index": 34, + "name": "Crossbow, hand", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Ranged", + "category_range": "Martial Ranged", + "cost": { + "quantity": 75, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 6, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 3, + "properties": [ + { + "url": "http://www.dnd5eapi.co/api/weapon-properties/1", + "name": "Ammunition" + }, + { + "name": "Light", + "url": "http://www.dnd5eapi.co/api/weapon-properties/4" + }, + { + "url": "http://www.dnd5eapi.co/api/weapon-properties/5", + "name": "Loading" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/34" + }, + { + "_id": "5bce91275b7768e792017dc2", + "index": 35, + "name": "Crossbow, heavy", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Ranged", + "category_range": "Martial Ranged", + "cost": { + "quantity": 50, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 10, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 18, + "properties": [ + { + "url": "http://www.dnd5eapi.co/api/weapon-properties/1", + "name": "Ammunition" + }, + { + "name": "Light", + "url": "http://www.dnd5eapi.co/api/weapon-properties/4" + }, + { + "url": "http://www.dnd5eapi.co/api/weapon-properties/5", + "name": "Loading" + }, + { + "name": "Two-Handed", + "url": "http://www.dnd5eapi.co/api/weapon-properties/9" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/35" + }, + { + "_id": "5bce91275b7768e792017dc1", + "index": 36, + "name": "Longbow", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Ranged", + "category_range": "Martial Ranged", + "cost": { + "quantity": 50, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 8, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/8", + "name": "Piercing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 2, + "properties": [ + { + "url": "http://www.dnd5eapi.co/api/weapon-properties/1", + "name": "Ammunition" + }, + { + "name": "Heavy", + "url": "http://www.dnd5eapi.co/api/weapon-properties/3" + }, + { + "name": "Two-Handed", + "url": "http://www.dnd5eapi.co/api/weapon-properties/9" + } + ], + "url": "http://www.dnd5eapi.co/api/equipment/36" + }, + { + "_id": "5bce91275b7768e792017dc6", + "index": 37, + "name": "Net", + "equipment_category": "Weapon", + "weapon_category:": "Martial", + "weapon_range": "Ranged", + "category_range": "Martial Ranged", + "cost": { + "quantity": 1, + "unit": "gp" + }, + "damage": { + "dice_count": 1, + "dice_value": 0, + "damage_type": { + "url": "http://www.dnd5eapi.co/api/damage-types/12", + "name": "Slashing" + } + }, + "range": { + "normal": 5, + "_long": null + }, + "weight": 3, + "properties": [ + { + "name": "Thrown", + "url": "http://www.dnd5eapi.co/api/weapon-properties/8" + }, + { + "name": "Special", + "url": "http://www.dnd5eapi.co/api/weapon-properties/7" + } + ], + "special": [ + "A Large or smaller creature hit by a net is restrained until it is freed. A net has no effect on creatures that are formless, or creatures that are Huge or larger. A creature can use its action to make a DC 10 Strength check, freeing itself or another creature within its reach on a success. Dealing 5 slashing damage to the net (AC 10) also frees the creature without harming it, ending the effect and destroying the net. When you use an action, bonus action, or reaction to attack with a net, you can make only one attack regardless of the number of attacks you can normally make." + ], + "throw_range": { + "normal": 5, + "_long": 15 + }, + "url": "http://www.dnd5eapi.co/api/equipment/37" + } +] \ No newline at end of file From de3b7e33153bb445a87404a8006dbe0184400a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20G=C3=B3rzy=C5=84ski?= Date: Sat, 2 Jan 2021 17:34:45 +0100 Subject: [PATCH 21/26] SES-120 Added scripts to populate armors and weapons --- .../ApplicationDbContext.cs | 55 ++++++ .../SessionCompanion.Database/SeedData.cs | 156 ++++++++++++++++++ .../SeedFromJsons.cs | 124 ++++++++++++++ 3 files changed, 335 insertions(+) create mode 100644 SessionCompanion/SessionCompanion.Database/SeedFromJsons.cs diff --git a/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs b/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs index 11bf6e7..a06705c 100644 --- a/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs +++ b/SessionCompanion/SessionCompanion.Database/ApplicationDbContext.cs @@ -1,7 +1,9 @@ using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json.Linq; using SessionCompanion.Database.Tables; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -33,6 +35,53 @@ namespace SessionCompanion.Database public ApplicationDbContext(DbContextOptions options) : base(options) { } + protected IEnumerable SeedWeapon() + { + const string file = "../SessionCompanion.Database/JsonData/weapons.json"; + List weapons = new List(); + using (StreamReader reader = new StreamReader(file)) + { + var json = reader.ReadToEnd(); + dynamic jweapons = JArray.Parse(json); + foreach (dynamic item in jweapons) + weapons.Add(SeedFromJsons.SingleWeaponSeeder(item)); + } + return weapons; + } + protected IEnumerable SeedArmor() + { + const string file = "../SessionCompanion.Database/JsonData/armors.json"; + List armors = new List(); + using (StreamReader reader = new StreamReader(file)) + { + var json = reader.ReadToEnd(); + dynamic jactions = JArray.Parse(json); + int id = 1; + foreach (dynamic item in jactions) + { + armors.Add(SeedFromJsons.SingleArmorSeeder(item, id)); + id++; + } + } + return armors; + } + protected IEnumerable SeedOtherEquipment() + { + const string file = "../SessionCompanion.Database/JsonData/otherEquipments.json"; + List otherEquipment = new List(); + using (StreamReader reader = new StreamReader(file)) + { + var json = reader.ReadToEnd(); + dynamic jactions = JArray.Parse(json); + int id = 1; + foreach (dynamic item in jactions) + { + otherEquipment.Add(SeedFromJsons.SingleOtherEquipmentSeeder(item, id)); + id++; + } + } + return otherEquipment; + } protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); @@ -44,6 +93,12 @@ namespace SessionCompanion.Database builder.Entity().HasData(SeedData.SeedBackground()); builder.Entity().HasData(SeedData.SeedBiography()); builder.Entity().HasData(SeedData.SeedStatistics()); + builder.Entity().HasData(SeedWeapon()); + builder.Entity().HasData(SeedArmor()); + builder.Entity().HasData(SeedOtherEquipment()); + builder.Entity().HasData(SeedData.SeedCharacterWeapon()); + builder.Entity().HasData(SeedData.SeedCharacterArmor()); + builder.Entity().HasData(SeedData.SeedCharacterOtherEquipment()); } } } diff --git a/SessionCompanion/SessionCompanion.Database/SeedData.cs b/SessionCompanion/SessionCompanion.Database/SeedData.cs index 38fda48..2dbef97 100644 --- a/SessionCompanion/SessionCompanion.Database/SeedData.cs +++ b/SessionCompanion/SessionCompanion.Database/SeedData.cs @@ -232,5 +232,161 @@ namespace SessionCompanion.Database }; return characters; } + + static public List SeedCharacterWeapon() + { + List characterWeapons = new List + { + new CharacterWeapon + { + Id = 1, + CharacterId = 1, + WeaponId = 1, + InUse = false, + HoldInLeftHand = false, + HoldInRightHand = false + }, + new CharacterWeapon + { + Id = 2, + CharacterId = 1, + WeaponId = 4, + InUse = true, + HoldInLeftHand = true, + HoldInRightHand = false + }, + new CharacterWeapon + { + Id = 3, + CharacterId = 2, + WeaponId = 2, + InUse = true, + HoldInLeftHand = false, + HoldInRightHand = true + }, + new CharacterWeapon + { + Id = 4, + CharacterId = 2, + WeaponId = 8, + InUse = false, + HoldInLeftHand = false, + HoldInRightHand = false + }, + new CharacterWeapon + { + Id = 5, + CharacterId = 3, + WeaponId = 9, + InUse = false, + HoldInLeftHand = false, + HoldInRightHand = false + }, + new CharacterWeapon + { + Id = 7, + CharacterId = 3, + WeaponId = 7, + InUse = true, + HoldInLeftHand = false, + HoldInRightHand = true + } + }; + return characterWeapons; + } + + static public List SeedCharacterArmor() + { + List characterArmors = new List + { + new CharacterArmor + { + Id = 1, + CharacterId = 1, + ArmorId = 1, + InUse = true, + }, + new CharacterArmor + { + Id = 2, + CharacterId = 1, + ArmorId = 3, + InUse = false, + }, + new CharacterArmor + { + Id = 3, + CharacterId = 2, + ArmorId = 2, + InUse = true, + }, + new CharacterArmor + { + Id = 4, + CharacterId = 2, + ArmorId = 5, + InUse = false, + }, + new CharacterArmor + { + Id = 5, + CharacterId = 3, + ArmorId = 6, + InUse = true, + }, + new CharacterArmor + { + Id = 6, + CharacterId = 3, + ArmorId = 2, + InUse = false, + } + }; + return characterArmors; + } + + static public List SeedCharacterOtherEquipment() + { + List characterOtherEquipment = new List + { + new CharacterOtherEquipment + { + Id = 1, + CharacterId = 1, + OtherEquipmentId = 1 + }, + new CharacterOtherEquipment + { + Id = 2, + CharacterId = 1, + OtherEquipmentId = 3 + }, + new CharacterOtherEquipment + { + Id = 3, + CharacterId = 2, + OtherEquipmentId = 2 + }, + new CharacterOtherEquipment + { + Id = 4, + CharacterId = 2, + OtherEquipmentId = 5 + }, + new CharacterOtherEquipment + { + Id = 5, + CharacterId = 3, + OtherEquipmentId = 6 + }, + new CharacterOtherEquipment + { + Id = 6, + CharacterId = 3, + OtherEquipmentId = 2 + } + }; + return characterOtherEquipment; + } } } diff --git a/SessionCompanion/SessionCompanion.Database/SeedFromJsons.cs b/SessionCompanion/SessionCompanion.Database/SeedFromJsons.cs new file mode 100644 index 0000000..162e969 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/SeedFromJsons.cs @@ -0,0 +1,124 @@ +using SessionCompanion.Database.Tables; +using SessionCompanion.ViewModels.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SessionCompanion.Database +{ + public static class SeedFromJsons + { + static public Weapon SingleWeaponSeeder(dynamic item) + { + Weapon weapon = new Weapon(); + + // Id + weapon.Id = item.index; + + // Name + weapon.Name = item.name; + + // Weapon type + weapon.WeaponType = item.category_range; + + // Cost + weapon.Cost = item.cost.quantity; + + // CurrnecyType + switch ((string)item.cost.unit) + { + case "sp": + weapon.CurrencyType = CurrencyType.sp; + break; + case "gp": + weapon.CurrencyType = CurrencyType.gp; + break; + } + + // DiceCount + weapon.DiceCount = item.damage.dice_count; + + // DiceValue + weapon.DiceValue = item.damage.dice_value; + + // RangeMeele + weapon.RangeMeele = item.range.normal; + + // RangeLong + weapon.RangeLong = item.range._long; + + // RangeThrow + if (item.throw_range != null) + { + weapon.RangeThrowNormal = item.throw_range.normal; + weapon.RangeThrowLong = item.throw_range._long; + } + + // Weight + weapon.Weight = item.weight; + + + // Twohand + if (item.two_hand_damage != null) + { + weapon.TwoHandDiceCount = item.two_hand_damage.dice_count; + weapon.TwoHandDiceValue = item.two_hand_damage.dice_value; + } + if (item.special != null) + weapon.Description = item.special[0]; + return weapon; + } + static public Armor SingleArmorSeeder(dynamic item, int id) + { + Armor armor = new Armor(); + + armor.Id = id; + armor.Name = item.name; + armor.Category = item.armor_category; + armor.ArmorClassBase = item.armor_class["base"]; + armor.HaveDexterityBonus = item.armor_class["dex_bonus"]; + armor.MinimumStrength = item.str_minimum; + armor.HaveStealthDisadvantage = item.stealth_disadvantage; + armor.Weight = item.weight; + armor.Cost = item.cost.quantity; + switch ((string)item.cost.unit) + { + case "sp": + armor.CurrencyType = CurrencyType.sp; + break; + case "gp": + armor.CurrencyType = CurrencyType.gp; + break; + } + + return armor; + } + static public OtherEquipment SingleOtherEquipmentSeeder(dynamic item, int id) + { + OtherEquipment otherEq = new OtherEquipment(); + + otherEq.Id = id; + otherEq.Name = item.name; + if (item.desc != null) + foreach (dynamic description in item.desc) + otherEq.Description += " " + description; + else + otherEq.Description = string.Empty; + + otherEq.Cost = item.cost.quantity; + switch ((string)item.cost.unit) + { + case "sp": + otherEq.CurrencyType = CurrencyType.sp; + break; + case "gp": + otherEq.CurrencyType = CurrencyType.gp; + break; + } + + return otherEq; + } + } +} From da96fea874fa142eadff9bf163dc7b31b4bfc78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20G=C3=B3rzy=C5=84ski?= Date: Sat, 2 Jan 2021 17:35:16 +0100 Subject: [PATCH 22/26] SES-120 Preform Migration --- .../20210102163136_weapons-added.Designer.cs | 2974 +++++++++++++++++ .../20210102163136_weapons-added.cs | 480 +++ .../ApplicationDbContextModelSnapshot.cs | 2136 ++++++++++++ .../SessionCompanion.Database.csproj | 4 + 4 files changed, 5594 insertions(+) create mode 100644 SessionCompanion/SessionCompanion.Database/Migrations/20210102163136_weapons-added.Designer.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Migrations/20210102163136_weapons-added.cs diff --git a/SessionCompanion/SessionCompanion.Database/Migrations/20210102163136_weapons-added.Designer.cs b/SessionCompanion/SessionCompanion.Database/Migrations/20210102163136_weapons-added.Designer.cs new file mode 100644 index 0000000..d008253 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Migrations/20210102163136_weapons-added.Designer.cs @@ -0,0 +1,2974 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SessionCompanion.Database; + +namespace SessionCompanion.Database.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20210102163136_weapons-added")] + partial class weaponsadded + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseIdentityColumns() + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.0"); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Alignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.HasKey("Id"); + + b.ToTable("Alignments"); + + b.HasData( + new + { + Id = 1 + }, + new + { + Id = 2 + }, + new + { + Id = 3 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Armor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("ArmorClassBase") + .HasColumnType("nvarchar(max)"); + + b.Property("Category") + .HasColumnType("nvarchar(max)"); + + b.Property("Cost") + .HasColumnType("int"); + + b.Property("CurrencyType") + .HasColumnType("int"); + + b.Property("HaveDexterityBonus") + .HasColumnType("bit"); + + b.Property("HaveStealthDisadvantage") + .HasColumnType("bit"); + + b.Property("MinimumStrength") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Weight") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Armors"); + + b.HasData( + new + { + Id = 1, + ArmorClassBase = "11", + Category = "Light", + Cost = 5, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = true, + MinimumStrength = 0, + Name = "Padded", + Weight = 8 + }, + new + { + Id = 2, + ArmorClassBase = "11", + Category = "Light", + Cost = 10, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Leather", + Weight = 10 + }, + new + { + Id = 3, + ArmorClassBase = "12", + Category = "Light", + Cost = 45, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Studded Leather", + Weight = 13 + }, + new + { + Id = 4, + ArmorClassBase = "12", + Category = "Medium", + Cost = 10, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Hide", + Weight = 12 + }, + new + { + Id = 5, + ArmorClassBase = "13", + Category = "Medium", + Cost = 50, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Chain Shirt", + Weight = 20 + }, + new + { + Id = 6, + ArmorClassBase = "14", + Category = "Medium", + Cost = 50, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = true, + MinimumStrength = 0, + Name = "Scale Mail", + Weight = 45 + }, + new + { + Id = 7, + ArmorClassBase = "14", + Category = "Medium", + Cost = 400, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Breastplate", + Weight = 20 + }, + new + { + Id = 8, + ArmorClassBase = "15", + Category = "Medium", + Cost = 750, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = true, + MinimumStrength = 0, + Name = "Half Plate", + Weight = 40 + }, + new + { + Id = 9, + ArmorClassBase = "14", + Category = "Heavy", + Cost = 30, + CurrencyType = 3, + HaveDexterityBonus = false, + HaveStealthDisadvantage = true, + MinimumStrength = 0, + Name = "Ring Mail", + Weight = 40 + }, + new + { + Id = 10, + ArmorClassBase = "16", + Category = "Heavy", + Cost = 75, + CurrencyType = 3, + HaveDexterityBonus = false, + HaveStealthDisadvantage = true, + MinimumStrength = 13, + Name = "Chain Mail", + Weight = 55 + }, + new + { + Id = 11, + ArmorClassBase = "17", + Category = "Heavy", + Cost = 200, + CurrencyType = 3, + HaveDexterityBonus = false, + HaveStealthDisadvantage = true, + MinimumStrength = 15, + Name = "Splint", + Weight = 60 + }, + new + { + Id = 12, + ArmorClassBase = "18", + Category = "Heavy", + Cost = 1500, + CurrencyType = 3, + HaveDexterityBonus = false, + HaveStealthDisadvantage = true, + MinimumStrength = 15, + Name = "Plate", + Weight = 65 + }, + new + { + Id = 13, + ArmorClassBase = "2", + Category = "Shield", + Cost = 10, + CurrencyType = 3, + HaveDexterityBonus = false, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Shield", + Weight = 6 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Background", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.HasKey("Id"); + + b.ToTable("Backgrounds"); + + b.HasData( + new + { + Id = 1 + }, + new + { + Id = 2 + }, + new + { + Id = 3 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Biography", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("AlignmentId") + .HasColumnType("int"); + + b.Property("BackgroundId") + .HasColumnType("int"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("ClassId") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("RaceId") + .HasColumnType("int"); + + b.Property("Sex") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("AlignmentId"); + + b.HasIndex("BackgroundId"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.HasIndex("ClassId"); + + b.HasIndex("RaceId"); + + b.ToTable("Biographies"); + + b.HasData( + new + { + Id = 1, + AlignmentId = 1, + BackgroundId = 1, + CharacterId = 1, + ClassId = 1, + Name = "Bob", + RaceId = 1, + Sex = "Male" + }, + new + { + Id = 2, + AlignmentId = 2, + BackgroundId = 2, + CharacterId = 2, + ClassId = 2, + Name = "Queen Daenerys Stormborn of the House Targaryen, the First of Her Name, Queen of the Andals, the Rhoynar and the First Men, Lady of the Seven Kingdoms and Protector of the Realm, Lady of Dragonstone, Queen of Meereen, Khaleesi of the Great Grass Sea, the Unburnt, Breaker of Chains and Mother of Dragons.", + RaceId = 2, + Sex = "Female" + }, + new + { + Id = 3, + AlignmentId = 3, + BackgroundId = 3, + CharacterId = 3, + ClassId = 3, + Name = "Gandalf the White", + RaceId = 3, + Sex = "Both" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Characters"); + + b.HasData( + new + { + Id = 1, + UserId = 1 + }, + new + { + Id = 2, + UserId = 2 + }, + new + { + Id = 3, + UserId = 3 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterArmor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("InUse") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("ArmorId"); + + b.HasIndex("CharacterId"); + + b.ToTable("CharacterArmors"); + + b.HasData( + new + { + Id = 1, + ArmorId = 1, + CharacterId = 1, + InUse = true + }, + new + { + Id = 2, + ArmorId = 3, + CharacterId = 1, + InUse = false + }, + new + { + Id = 3, + ArmorId = 2, + CharacterId = 2, + InUse = true + }, + new + { + Id = 4, + ArmorId = 5, + CharacterId = 2, + InUse = false + }, + new + { + Id = 5, + ArmorId = 6, + CharacterId = 3, + InUse = true + }, + new + { + Id = 6, + ArmorId = 2, + CharacterId = 3, + InUse = false + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterOtherEquipment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("OtherEquipmentId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("OtherEquipmentId"); + + b.ToTable("CharacterOtherEquipment"); + + b.HasData( + new + { + Id = 1, + CharacterId = 1, + OtherEquipmentId = 1 + }, + new + { + Id = 2, + CharacterId = 1, + OtherEquipmentId = 3 + }, + new + { + Id = 3, + CharacterId = 2, + OtherEquipmentId = 2 + }, + new + { + Id = 4, + CharacterId = 2, + OtherEquipmentId = 5 + }, + new + { + Id = 5, + CharacterId = 3, + OtherEquipmentId = 6 + }, + new + { + Id = 6, + CharacterId = 3, + OtherEquipmentId = 2 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterWeapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("HoldInLeftHand") + .HasColumnType("bit"); + + b.Property("HoldInRightHand") + .HasColumnType("bit"); + + b.Property("InUse") + .HasColumnType("bit"); + + b.Property("WeaponId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("WeaponId"); + + b.ToTable("CharacterWeapons"); + + b.HasData( + new + { + Id = 1, + CharacterId = 1, + HoldInLeftHand = false, + HoldInRightHand = false, + InUse = false, + WeaponId = 1 + }, + new + { + Id = 2, + CharacterId = 1, + HoldInLeftHand = true, + HoldInRightHand = false, + InUse = true, + WeaponId = 4 + }, + new + { + Id = 3, + CharacterId = 2, + HoldInLeftHand = false, + HoldInRightHand = true, + InUse = true, + WeaponId = 2 + }, + new + { + Id = 4, + CharacterId = 2, + HoldInLeftHand = false, + HoldInRightHand = false, + InUse = false, + WeaponId = 8 + }, + new + { + Id = 5, + CharacterId = 3, + HoldInLeftHand = false, + HoldInRightHand = false, + InUse = false, + WeaponId = 9 + }, + new + { + Id = 7, + CharacterId = 3, + HoldInLeftHand = false, + HoldInRightHand = true, + InUse = true, + WeaponId = 7 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Charisma", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("CanDeception") + .HasColumnType("bit"); + + b.Property("CanIntimidation") + .HasColumnType("bit"); + + b.Property("CanPerformance") + .HasColumnType("bit"); + + b.Property("CanPersuasion") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Deception") + .HasColumnType("int"); + + b.Property("Intimidation") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("Performance") + .HasColumnType("int"); + + b.Property("Persuasion") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Charismas"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Class", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Classes"); + + b.HasData( + new + { + Id = 1, + Name = "Fighter" + }, + new + { + Id = 2, + Name = "Paladin" + }, + new + { + Id = 3, + Name = "Cleric" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Constitution", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Constitutions"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Dexterity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Acrobatics") + .HasColumnType("int"); + + b.Property("CanAcrobatics") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CanSleightOfHand") + .HasColumnType("bit"); + + b.Property("CanStealth") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("SleightOfHand") + .HasColumnType("int"); + + b.Property("Stealth") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Dexterities"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Intelligence", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Arcana") + .HasColumnType("int"); + + b.Property("CanArcana") + .HasColumnType("bit"); + + b.Property("CanHistory") + .HasColumnType("bit"); + + b.Property("CanInvestigation") + .HasColumnType("bit"); + + b.Property("CanNature") + .HasColumnType("bit"); + + b.Property("CanReligion") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("History") + .HasColumnType("int"); + + b.Property("Investigation") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("Nature") + .HasColumnType("int"); + + b.Property("Religion") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Intelligences"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.OtherEquipment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Cost") + .HasColumnType("int"); + + b.Property("CurrencyType") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("OtherEquipment"); + + b.HasData( + new + { + Id = 1, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Abacus" + }, + new + { + Id = 2, + Cost = 25, + CurrencyType = 3, + Description = " As an action, you can splash the contents of this vial onto a creature within 5 feet of you or throw the vial up to 20 feet, shattering it on impact. In either case, make a ranged attack against a creature or object, treating the acid as an improvised weapon. On a hit, the target takes 2d6 acid damage.", + Name = "Acid (vial)" + }, + new + { + Id = 3, + Cost = 50, + CurrencyType = 3, + Description = " This sticky, adhesive fluid ignites when exposed to air. As an action, you can throw this flask up to 20 feet, shattering it on impact. Make a ranged attack against a creature or object, treating the alchemist's fire as an improvised weapon. On a hit, the target takes 1d4 fire damage at the start of each of its turns. A creature can end this damage by using its action to make a DC 10 Dexterity check to extinguish the flames.", + Name = "Alchemist's fire (flask)" + }, + new + { + Id = 4, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Arrow" + }, + new + { + Id = 5, + Cost = 2, + CurrencyType = 0, + Description = "", + Name = "Blowgun needle" + }, + new + { + Id = 6, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Crossbow bolt" + }, + new + { + Id = 7, + Cost = 1, + CurrencyType = 0, + Description = "", + Name = "Sling bullet" + }, + new + { + Id = 8, + Cost = 5, + CurrencyType = 3, + Description = " A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.", + Name = "Amulet" + }, + new + { + Id = 9, + Cost = 50, + CurrencyType = 3, + Description = " A creature that drinks this vial of liquid gains advantage on saving throws against poison for 1 hour. It confers no benefit to undead or constructs.", + Name = "Antitoxin (vial)" + }, + new + { + Id = 10, + Cost = 10, + CurrencyType = 3, + Description = " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", + Name = "Crystal" + }, + new + { + Id = 11, + Cost = 20, + CurrencyType = 3, + Description = " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", + Name = "Orb" + }, + new + { + Id = 12, + Cost = 10, + CurrencyType = 3, + Description = " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", + Name = "Rod" + }, + new + { + Id = 13, + Cost = 5, + CurrencyType = 3, + Description = " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", + Name = "Staff" + }, + new + { + Id = 14, + Cost = 10, + CurrencyType = 3, + Description = " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", + Name = "Wand" + }, + new + { + Id = 15, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Backpack" + }, + new + { + Id = 16, + Cost = 1, + CurrencyType = 3, + Description = " As an action, you can spill these tiny metal balls from their pouch to cover a level, square area that is 10 feet on a side. A creature moving across the covered area must succeed on a DC 10 Dexterity saving throw or fall prone. A creature moving through the area at half speed doesn't need to make the save.", + Name = "Ball bearings (bag of 1,000)" + }, + new + { + Id = 17, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Barrel" + }, + new + { + Id = 18, + Cost = 4, + CurrencyType = 1, + Description = "", + Name = "Basket" + }, + new + { + Id = 19, + Cost = 1, + CurrencyType = 3, + Description = "", + Name = "Bedroll" + }, + new + { + Id = 20, + Cost = 1, + CurrencyType = 3, + Description = "", + Name = "Bell" + }, + new + { + Id = 21, + Cost = 5, + CurrencyType = 1, + Description = "", + Name = "Blanket" + }, + new + { + Id = 22, + Cost = 1, + CurrencyType = 3, + Description = " A set of pulleys with a cable threaded through them and a hook to attach to objects, a block and tackle allows you to hoist up to four times the weight you can normally lift.", + Name = "Block and tackle" + }, + new + { + Id = 23, + Cost = 25, + CurrencyType = 3, + Description = " A book might contain poetry, historical accounts, information pertaining to a particular field of lore, diagrams and notes on gnomish contraptions, or just about anything else that can be represented using text or pictures. A book of spells is a spellbook (described later in this section).", + Name = "Book" + }, + new + { + Id = 24, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Bottle, glass" + }, + new + { + Id = 25, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Bucket" + }, + new + { + Id = 26, + Cost = 5, + CurrencyType = 0, + Description = " As an action, you can spread a bag of caltrops to cover a square area that is 5 feet on a side. Any creature that enters the area must succeed on a DC 15 Dexterity saving throw or stop moving this turn and take 1 piercing damage. Taking this damage reduces the creature's walking speed by 10 feet until the creature regains at least 1 hit point. A creature moving through the area at half speed doesn't need to make the save.", + Name = "Caltrops" + }, + new + { + Id = 27, + Cost = 1, + CurrencyType = 0, + Description = " For 1 hour, a candle sheds bright light in a 5-foot radius and dim light for an additional 5 feet.", + Name = "Candle" + }, + new + { + Id = 28, + Cost = 1, + CurrencyType = 3, + Description = " This wooden case can hold up to twenty crossbow bolts.", + Name = "Case, crossbow bolt" + }, + new + { + Id = 29, + Cost = 1, + CurrencyType = 3, + Description = " This cylindrical leather case can hold up to ten rolled-up sheets of paper or five rolled-up sheets of parchment.", + Name = "Case, map or scroll" + }, + new + { + Id = 30, + Cost = 5, + CurrencyType = 3, + Description = " A chain has 10 hit points. It can be burst with a successful DC 20 Strength check.", + Name = "Chain (10 feet)" + }, + new + { + Id = 31, + Cost = 1, + CurrencyType = 0, + Description = "", + Name = "Chalk (1 piece)" + }, + new + { + Id = 32, + Cost = 5, + CurrencyType = 3, + Description = "", + Name = "Chest" + }, + new + { + Id = 33, + Cost = 5, + CurrencyType = 1, + Description = "", + Name = "Clothes, common" + }, + new + { + Id = 34, + Cost = 5, + CurrencyType = 3, + Description = "", + Name = "Clothes, costume" + }, + new + { + Id = 35, + Cost = 15, + CurrencyType = 3, + Description = "", + Name = "Clothes, fine" + }, + new + { + Id = 36, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Clothes, traveler's" + }, + new + { + Id = 37, + Cost = 25, + CurrencyType = 3, + Description = " A component pouch is a small, watertight leather belt pouch that has compartments to hold all the material components and other special items you need to cast your spells, except for those components that have a specific cost (as indicated in a spell's description).", + Name = "Component pouch" + }, + new + { + Id = 38, + Cost = 2, + CurrencyType = 3, + Description = " Using a crowbar grants advantage to Strength checks where the crowbar's leverage can be applied.", + Name = "Crowbar" + }, + new + { + Id = 39, + Cost = 1, + CurrencyType = 3, + Description = " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", + Name = "Sprig of mistletoe" + }, + new + { + Id = 40, + Cost = 1, + CurrencyType = 3, + Description = " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", + Name = "Totem" + }, + new + { + Id = 41, + Cost = 5, + CurrencyType = 3, + Description = " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", + Name = "Wooden staff" + }, + new + { + Id = 42, + Cost = 10, + CurrencyType = 3, + Description = " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", + Name = "Yew wand" + }, + new + { + Id = 43, + Cost = 5, + CurrencyType = 3, + Description = " A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.", + Name = "Emblem" + }, + new + { + Id = 44, + Cost = 1, + CurrencyType = 3, + Description = " This kit includes a wooden rod, silken line, corkwood bobbers, steel hooks, lead sinkers, velvet lures, and narrow netting.", + Name = "Fishing tackle" + }, + new + { + Id = 45, + Cost = 2, + CurrencyType = 0, + Description = "", + Name = "Flask or tankard" + }, + new + { + Id = 46, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Grappling hook" + }, + new + { + Id = 47, + Cost = 1, + CurrencyType = 3, + Description = "", + Name = "Hammer" + }, + new + { + Id = 48, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Hammer, sledge" + }, + new + { + Id = 49, + Cost = 25, + CurrencyType = 3, + Description = " As an action, you can splash the contents of this flask onto a creature within 5 feet of you or throw it up to 20 feet, shattering it on impact. In either case, make a ranged attack against a target creature, treating the holy water as an improvised weapon. If the target is a fiend or undead, it takes 2d6 radiant damage. A cleric or paladin may create holy water by performing a special ritual. The ritual takes 1 hour to perform, uses 25 gp worth of powdered silver, and requires the caster to expend a 1st-level spell slot.", + Name = "Holy water (flask)" + }, + new + { + Id = 50, + Cost = 25, + CurrencyType = 3, + Description = "", + Name = "Hourglass" + }, + new + { + Id = 51, + Cost = 5, + CurrencyType = 3, + Description = " When you use your action to set it, this trap forms a saw-toothed steel ring that snaps shut when a creature steps on a pressure plate in the center. The trap is affixed by a heavy chain to an immobile object, such as a tree or a spike driven into the ground. A creature that steps on the plate must succeed on a DC 13 Dexterity saving throw or take 1d4 piercing damage and stop moving. Thereafter, until the creature breaks free of the trap, its movement is limited by the length of the chain (typically 3 feet long). A creature can use its action to make a DC 13 Strength check, freeing itself or another creature within its reach on a success. Each failed check deals 1 piercing damage to the trapped creature.", + Name = "Hunting trap" + }, + new + { + Id = 52, + Cost = 10, + CurrencyType = 3, + Description = "", + Name = "Ink (1 ounce bottle)" + }, + new + { + Id = 53, + Cost = 2, + CurrencyType = 0, + Description = "", + Name = "Ink pen" + }, + new + { + Id = 54, + Cost = 2, + CurrencyType = 0, + Description = "", + Name = "Jug or pitcher" + }, + new + { + Id = 55, + Cost = 25, + CurrencyType = 3, + Description = " A climber's kit includes special pitons, boot tips, gloves, and a harness. You can use the climber's kit as an action to anchor yourself; when you do, you can't fall more than 25 feet from the point where you anchored yourself, and you can't climb more than 25 feet away from that point without undoing the anchor.", + Name = "Climber's Kit" + }, + new + { + Id = 56, + Cost = 25, + CurrencyType = 3, + Description = " This pouch of cosmetics, hair dye, and small props lets you create disguises that change your physical appearance. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to create a visual disguise.", + Name = "Disguise Kit" + }, + new + { + Id = 57, + Cost = 15, + CurrencyType = 3, + Description = " This small box contains a variety of papers and parchments, pens and inks, seals and sealing wax, gold and silver leaf, and other supplies necessary to create convincing forgeries of physical documents. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to create a physical forgery of a document.", + Name = "Forgery Kit" + }, + new + { + Id = 58, + Cost = 5, + CurrencyType = 3, + Description = " This kit contains a variety of instruments such as clippers, mortar and pestle, and pouches and vials used by herbalists to create remedies and potions. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to identify or apply herbs. Also, proficiency with this kit is required to create antitoxin and potions of healing.", + Name = "Herbalism Kit" + }, + new + { + Id = 59, + Cost = 5, + CurrencyType = 3, + Description = " This kit is a leather pouch containing bandages, salves, and splints. The kit has ten uses. As an action, you can expend one use of the kit to stabilize a creature that has 0 hit points, without needing to make a Wisdom (Medicine) check.", + Name = "Healer's Kit" + }, + new + { + Id = 60, + Cost = 2, + CurrencyType = 1, + Description = " This tin box contains a cup and simple cutlery. The box clamps together, and one side can be used as a cooking pan and the other as a plate or shallow bowl.", + Name = "Mess Kit" + }, + new + { + Id = 61, + Cost = 50, + CurrencyType = 3, + Description = " A poisoner's kit includes the vials, chemicals, and other equipment necessary for the creation of poisons. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to craft or use poisons.", + Name = "Poisoner's Kit" + }, + new + { + Id = 62, + Cost = 1, + CurrencyType = 1, + Description = "", + Name = "Ladder (10-foot)" + }, + new + { + Id = 63, + Cost = 5, + CurrencyType = 1, + Description = " A lamp casts bright light in a 15-foot radius and dim light for an additional 30 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil.", + Name = "Lamp" + }, + new + { + Id = 64, + Cost = 10, + CurrencyType = 3, + Description = " A bullseye lantern casts bright light in a 60-foot cone and dim light for an additional 60 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil.", + Name = "Lantern, bullseye" + }, + new + { + Id = 65, + Cost = 5, + CurrencyType = 3, + Description = " A hooded lantern casts bright light in a 30-foot radius and dim light for an additional 30 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil. As an action, you can lower the hood, reducing the light to dim light in a 5-foot radius.", + Name = "Lantern, hooded" + }, + new + { + Id = 66, + Cost = 10, + CurrencyType = 3, + Description = " A key is provided with the lock. Without the key, a creature proficient with thieves' tools can pick this lock with a successful DC 15 Dexterity check. Your GM may decide that better locks are available for higher prices.", + Name = "Lock" + }, + new + { + Id = 67, + Cost = 100, + CurrencyType = 3, + Description = " This lens allows a closer look at small objects. It is also useful as a substitute for flint and steel when starting fires. Lighting a fire with a magnifying glass requires light as bright as sunlight to focus, tinder to ignite, and about 5 minutes for the fire to ignite. A magnifying glass grants advantage on any ability check made to appraise or inspect an item that is small or highly detailed.", + Name = "Magnifying glass" + }, + new + { + Id = 68, + Cost = 2, + CurrencyType = 3, + Description = " These metal restraints can bind a Small or Medium creature. Escaping the manacles requires a successful DC 20 Dexterity check. Breaking them requires a successful DC 20 Strength check. Each set of manacles comes with one key. Without the key, a creature proficient with thieves' tools can pick the manacles' lock with a successful DC 15 Dexterity check. Manacles have 15 hit points.", + Name = "Manacles" + }, + new + { + Id = 69, + Cost = 5, + CurrencyType = 3, + Description = "", + Name = "Mirror, steel" + }, + new + { + Id = 70, + Cost = 1, + CurrencyType = 1, + Description = " Oil usually comes in a clay flask that holds 1 pint. As an action, you can splash the oil in this flask onto a creature within 5 feet of you or throw it up to 20 feet, shattering it on impact. Make a ranged attack against a target creature or object, treating the oil as an improvised weapon. On a hit, the target is covered in oil. If the target takes any fire damage before the oil dries (after 1 minute), the target takes an additional 5 fire damage from the burning oil. You can also pour a flask of oil on the ground to cover a 5-foot-square area, provided that the surface is level. If lit, the oil burns for 2 rounds and deals 5 fire damage to any creature that enters the area or ends its turn in the area. A creature can take this damage only once per turn.", + Name = "Oil (flask)" + }, + new + { + Id = 71, + Cost = 2, + CurrencyType = 1, + Description = "", + Name = "Paper (one sheet)" + }, + new + { + Id = 72, + Cost = 1, + CurrencyType = 1, + Description = "", + Name = "Parchment (one sheet)" + }, + new + { + Id = 73, + Cost = 5, + CurrencyType = 3, + Description = "", + Name = "Perfume (vial)" + }, + new + { + Id = 74, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Pick, miner's" + }, + new + { + Id = 75, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Piton" + }, + new + { + Id = 76, + Cost = 100, + CurrencyType = 3, + Description = " You can use the poison in this vial to coat one slashing or piercing weapon or up to three pieces of ammunition. Applying the poison takes an action. A creature hit by the poisoned weapon or ammunition must make a DC 10 Constitution saving throw or take 1d4 poison damage. Once applied, the poison retains potency for 1 minute before drying.", + Name = "Poison, basic (vial)" + }, + new + { + Id = 77, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Pole (10-foot)" + }, + new + { + Id = 78, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Pot, iron" + }, + new + { + Id = 79, + Cost = 50, + CurrencyType = 3, + Description = " A character who drinks the magical red fluid in this vial regains 2d4 + 2 hit points. Drinking or administering a potion takes an action.", + Name = "Potion of healing" + }, + new + { + Id = 80, + Cost = 5, + CurrencyType = 1, + Description = " A cloth or leather pouch can hold up to 20 sling bullets or 50 blowgun needles, among other things. A compartmentalized pouch for holding spell components is called a component pouch (described earlier in this section).", + Name = "Pouch" + }, + new + { + Id = 81, + Cost = 1, + CurrencyType = 3, + Description = " A quiver can hold up to 20 arrows.", + Name = "Quiver" + }, + new + { + Id = 82, + Cost = 4, + CurrencyType = 3, + Description = " You can use a portable ram to break down doors. When doing so, you gain a +4 bonus on the Strength check. One other character can help you use the ram, giving you advantage on this check.", + Name = "Ram, portable" + }, + new + { + Id = 83, + Cost = 5, + CurrencyType = 1, + Description = " Rations consist of dry foods suitable for extended travel, including jerky, dried fruit, hardtack, and nuts.", + Name = "Rations (1 day)" + }, + new + { + Id = 84, + Cost = 5, + CurrencyType = 3, + Description = " A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.", + Name = "Reliquary" + }, + new + { + Id = 85, + Cost = 1, + CurrencyType = 3, + Description = "", + Name = "Robes" + }, + new + { + Id = 86, + Cost = 1, + CurrencyType = 3, + Description = " Rope, whether made of hemp or silk, has 2 hit points and can be burst with a DC 17 Strength check.", + Name = "Rope, hempen (50 feet)" + }, + new + { + Id = 87, + Cost = 10, + CurrencyType = 3, + Description = " Rope, whether made of hemp or silk, has 2 hit points and can be burst with a DC 17 Strength check.", + Name = "Rope, silk (50 feet)" + }, + new + { + Id = 88, + Cost = 1, + CurrencyType = 0, + Description = "", + Name = "Sack" + }, + new + { + Id = 89, + Cost = 5, + CurrencyType = 3, + Description = " A scale includes a small balance, pans, and a suitable assortment of weights up to 2 pounds. With it, you can measure the exact weight of small objects, such as raw precious metals or trade goods, to help determine their worth.", + Name = "Scale, merchant's" + }, + new + { + Id = 90, + Cost = 5, + CurrencyType = 1, + Description = "", + Name = "Sealing wax" + }, + new + { + Id = 91, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Shovel" + }, + new + { + Id = 92, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Signal whistle" + }, + new + { + Id = 93, + Cost = 5, + CurrencyType = 3, + Description = "", + Name = "Signet ring" + }, + new + { + Id = 94, + Cost = 2, + CurrencyType = 0, + Description = "", + Name = "Soap" + }, + new + { + Id = 95, + Cost = 50, + CurrencyType = 3, + Description = " Essential for wizards, a spellbook is a leather-bound tome with 100 blank vellum pages suitable for recording spells.", + Name = "Spellbook" + }, + new + { + Id = 96, + Cost = 1, + CurrencyType = 1, + Description = "", + Name = "Spike, iron" + }, + new + { + Id = 97, + Cost = 1000, + CurrencyType = 3, + Description = " Objects viewed through a spyglass are magnified to twice their size.", + Name = "Spyglass" + }, + new + { + Id = 98, + Cost = 2, + CurrencyType = 3, + Description = " A simple and portable canvas shelter, a tent sleeps two.", + Name = "Tent, two-person" + }, + new + { + Id = 99, + Cost = 5, + CurrencyType = 1, + Description = " This small container holds flint, fire steel, and tinder (usually dry cloth soaked in light oil) used to kindle a fire. Using it to light a torch--or anything else with abundant, exposed fuel--takes an action. Lighting any other fire takes 1 minute.", + Name = "Tinderbox" + }, + new + { + Id = 100, + Cost = 1, + CurrencyType = 0, + Description = " A torch burns for 1 hour, providing bright light in a 20-foot radius and dim light for an additional 20 feet. If you make a melee attack with a burning torch and hit, it deals 1 fire damage.", + Name = "Torch" + }, + new + { + Id = 101, + Cost = 1, + CurrencyType = 3, + Description = "", + Name = "Vial" + }, + new + { + Id = 102, + Cost = 2, + CurrencyType = 1, + Description = "", + Name = "Waterskin" + }, + new + { + Id = 103, + Cost = 1, + CurrencyType = 0, + Description = "", + Name = "Whetstone" + }, + new + { + Id = 104, + Cost = 16, + CurrencyType = 3, + Description = "", + Name = "Burglar's Pack" + }, + new + { + Id = 105, + Cost = 50, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Alchemist's supplies" + }, + new + { + Id = 106, + Cost = 20, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Brewer's supplies" + }, + new + { + Id = 107, + Cost = 10, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Calligrapher's supplies" + }, + new + { + Id = 108, + Cost = 8, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Carpenter's tools" + }, + new + { + Id = 109, + Cost = 15, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Cartographer's tools" + }, + new + { + Id = 110, + Cost = 5, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Cobbler's tools" + }, + new + { + Id = 111, + Cost = 1, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Cook's utensils" + }, + new + { + Id = 112, + Cost = 30, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Glassblower's tools" + }, + new + { + Id = 113, + Cost = 25, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Jeweler's tools" + }, + new + { + Id = 114, + Cost = 5, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Leatherworker's tools" + }, + new + { + Id = 115, + Cost = 10, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Mason's tools" + }, + new + { + Id = 116, + Cost = 10, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Painter's supplies" + }, + new + { + Id = 117, + Cost = 10, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Potter's tools" + }, + new + { + Id = 118, + Cost = 20, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Smith's tools" + }, + new + { + Id = 119, + Cost = 50, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Tinker's tools" + }, + new + { + Id = 120, + Cost = 1, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Weaver's tools" + }, + new + { + Id = 121, + Cost = 1, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Woodcarver's tools" + }, + new + { + Id = 122, + Cost = 1, + CurrencyType = 1, + Description = " This item encompasses a wide range of game pieces, including dice and decks of cards (for games such as Three-Dragon Ante). A few common examples appear on the Tools table, but other kinds of gaming sets exist. If you are proficient with a gaming set, you can add your proficiency bonus to ability checks you make to play a game with that set. Each type of gaming set requires a separate proficiency.", + Name = "Dice set" + }, + new + { + Id = 123, + Cost = 5, + CurrencyType = 1, + Description = " This item encompasses a wide range of game pieces, including dice and decks of cards (for games such as Three-Dragon Ante). A few common examples appear on the Tools table, but other kinds of gaming sets exist. If you are proficient with a gaming set, you can add your proficiency bonus to ability checks you make to play a game with that set. Each type of gaming set requires a separate proficiency.", + Name = "Playing card set" + }, + new + { + Id = 124, + Cost = 30, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Bagpipes" + }, + new + { + Id = 125, + Cost = 6, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Drum" + }, + new + { + Id = 126, + Cost = 25, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Dulcimer" + }, + new + { + Id = 127, + Cost = 2, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Flute" + }, + new + { + Id = 128, + Cost = 35, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Lute" + }, + new + { + Id = 129, + Cost = 30, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Lyre" + }, + new + { + Id = 130, + Cost = 3, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Horn" + }, + new + { + Id = 131, + Cost = 12, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Pan flute" + }, + new + { + Id = 132, + Cost = 2, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Shawm" + }, + new + { + Id = 133, + Cost = 30, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Viol" + }, + new + { + Id = 134, + Cost = 25, + CurrencyType = 3, + Description = " This set of instruments is used for navigation at sea. Proficiency with navigator's tools lets you chart a ship's course and follow navigation charts. In addition, these tools allow you to add your proficiency bonus to any ability check you make to avoid getting lost at sea.", + Name = "Navigator's tools" + }, + new + { + Id = 135, + Cost = 25, + CurrencyType = 3, + Description = " This set of tools includes a small file, a set of lock picks, a small mirror mounted on a metal handle, a set of narrow-bladed scissors, and a pair of pliers. Proficiency with these tools lets you add your proficiency bonus to any ability checks you make to disarm traps or open locks.", + Name = "Thieves' tools" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Race", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Races"); + + b.HasData( + new + { + Id = 1, + Name = "Human" + }, + new + { + Id = 2, + Name = "Dwarf" + }, + new + { + Id = 3, + Name = "Elf" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Statistics", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("ArmorClass") + .HasColumnType("int"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("CurrentHealthPoints") + .HasColumnType("int"); + + b.Property("ExperiencePoints") + .HasColumnType("int"); + + b.Property("HealthPoints") + .HasColumnType("int"); + + b.Property("Initiative") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Proficiency") + .HasColumnType("int"); + + b.Property("Speed") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Statistics"); + + b.HasData( + new + { + Id = 1, + ArmorClass = 9, + CharacterId = 1, + CurrentHealthPoints = 18, + ExperiencePoints = 2, + HealthPoints = 20, + Initiative = 12, + Level = 1, + Proficiency = 1, + Speed = 5 + }, + new + { + Id = 2, + ArmorClass = 12, + CharacterId = 2, + CurrentHealthPoints = 26, + ExperiencePoints = 0, + HealthPoints = 26, + Initiative = 7, + Level = 1, + Proficiency = 1, + Speed = 10 + }, + new + { + Id = 3, + ArmorClass = 2, + CharacterId = 3, + CurrentHealthPoints = 7, + ExperiencePoints = 24, + HealthPoints = 7, + Initiative = 18, + Level = 1, + Proficiency = 2, + Speed = 15 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Strength", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Athletics") + .HasColumnType("int"); + + b.Property("CanAthletics") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Strengths"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Password") + .HasColumnType("nvarchar(max)"); + + b.Property("Username") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Users"); + + b.HasData( + new + { + Id = 1, + Password = "123", + Username = "Morwiec" + }, + new + { + Id = 2, + Password = "123", + Username = "Cichoklepiec" + }, + new + { + Id = 3, + Password = "123", + Username = "Ruletka" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Weapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Cost") + .HasColumnType("int"); + + b.Property("CurrencyType") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DiceCount") + .HasColumnType("int"); + + b.Property("DiceValue") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("RangeLong") + .HasColumnType("int"); + + b.Property("RangeMeele") + .HasColumnType("int"); + + b.Property("RangeThrowLong") + .HasColumnType("int"); + + b.Property("RangeThrowNormal") + .HasColumnType("int"); + + b.Property("TwoHandDamageType") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoHandDiceCount") + .HasColumnType("int"); + + b.Property("TwoHandDiceValue") + .HasColumnType("int"); + + b.Property("WeaponType") + .HasColumnType("nvarchar(max)"); + + b.Property("Weight") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Weapons"); + + b.HasData( + new + { + Id = 1, + Cost = 1, + CurrencyType = 1, + DiceCount = 1, + DiceValue = 4, + Name = "Club", + RangeMeele = 5, + WeaponType = "Simple Melee", + Weight = 2 + }, + new + { + Id = 2, + Cost = 2, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 4, + Name = "Dagger", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + WeaponType = "Simple Melee", + Weight = 1 + }, + new + { + Id = 3, + Cost = 2, + CurrencyType = 1, + DiceCount = 1, + DiceValue = 8, + Name = "Greatclub", + RangeMeele = 5, + WeaponType = "Simple Melee", + Weight = 10 + }, + new + { + Id = 4, + Cost = 5, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Handaxe", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + WeaponType = "Simple Melee", + Weight = 2 + }, + new + { + Id = 5, + Cost = 5, + CurrencyType = 1, + DiceCount = 1, + DiceValue = 6, + Name = "Javelin", + RangeMeele = 5, + RangeThrowLong = 120, + RangeThrowNormal = 30, + WeaponType = "Simple Melee", + Weight = 2 + }, + new + { + Id = 6, + Cost = 2, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 4, + Name = "Light hammer", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + WeaponType = "Simple Melee", + Weight = 2 + }, + new + { + Id = 7, + Cost = 5, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Mace", + RangeMeele = 5, + WeaponType = "Simple Melee", + Weight = 4 + }, + new + { + Id = 8, + Cost = 2, + CurrencyType = 1, + DiceCount = 1, + DiceValue = 6, + Name = "Quarterstaff", + RangeMeele = 5, + TwoHandDiceCount = 1, + TwoHandDiceValue = 8, + WeaponType = "Simple Melee", + Weight = 4 + }, + new + { + Id = 9, + Cost = 1, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 4, + Name = "Sickle", + RangeMeele = 5, + WeaponType = "Simple Melee", + Weight = 2 + }, + new + { + Id = 10, + Cost = 1, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 4, + Name = "Spear", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + TwoHandDiceCount = 1, + TwoHandDiceValue = 8, + WeaponType = "Simple Melee", + Weight = 3 + }, + new + { + Id = 11, + Cost = 25, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Crossbow, light", + RangeMeele = 5, + WeaponType = "Simple Ranged", + Weight = 5 + }, + new + { + Id = 12, + Cost = 5, + CurrencyType = 0, + DiceCount = 1, + DiceValue = 4, + Name = "Dart", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + WeaponType = "Simple Ranged", + Weight = 0 + }, + new + { + Id = 13, + Cost = 25, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Shortbow", + RangeMeele = 5, + WeaponType = "Simple Ranged", + Weight = 2 + }, + new + { + Id = 14, + Cost = 1, + CurrencyType = 1, + DiceCount = 1, + DiceValue = 4, + Name = "Sling", + RangeMeele = 5, + WeaponType = "Simple Ranged", + Weight = 0 + }, + new + { + Id = 15, + Cost = 10, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Battleaxe", + RangeMeele = 5, + TwoHandDiceCount = 1, + TwoHandDiceValue = 10, + WeaponType = "Martial Melee", + Weight = 4 + }, + new + { + Id = 16, + Cost = 10, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Flail", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 2 + }, + new + { + Id = 17, + Cost = 20, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 10, + Name = "Glaive", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 6 + }, + new + { + Id = 18, + Cost = 30, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 12, + Name = "Greataxe", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 7 + }, + new + { + Id = 19, + Cost = 50, + CurrencyType = 3, + DiceCount = 2, + DiceValue = 6, + Name = "Greatsword", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 6 + }, + new + { + Id = 20, + Cost = 20, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 10, + Name = "Halberd", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 6 + }, + new + { + Id = 21, + Cost = 10, + CurrencyType = 3, + Description = "You have disadvantage when you use a lance to attack a target within 5 feet of you. Also, a lance requires two hands to wield when you aren�t mounted.", + DiceCount = 1, + DiceValue = 12, + Name = "Lance", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 6 + }, + new + { + Id = 22, + Cost = 15, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Longsword", + RangeMeele = 5, + TwoHandDiceCount = 1, + TwoHandDiceValue = 10, + WeaponType = "Martial Melee", + Weight = 3 + }, + new + { + Id = 23, + Cost = 10, + CurrencyType = 3, + DiceCount = 2, + DiceValue = 6, + Name = "Maul", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 10 + }, + new + { + Id = 24, + Cost = 15, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Morningstar", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 4 + }, + new + { + Id = 25, + Cost = 5, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 10, + Name = "Pike", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 18 + }, + new + { + Id = 26, + Cost = 25, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Rapier", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 2 + }, + new + { + Id = 27, + Cost = 25, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Scimitar", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 3 + }, + new + { + Id = 28, + Cost = 10, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Shortsword", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 2 + }, + new + { + Id = 29, + Cost = 5, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Trident", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + WeaponType = "Martial Melee", + Weight = 4 + }, + new + { + Id = 30, + Cost = 5, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "War pick", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 2 + }, + new + { + Id = 31, + Cost = 15, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Warhammer", + RangeMeele = 5, + TwoHandDiceCount = 1, + TwoHandDiceValue = 10, + WeaponType = "Martial Melee", + Weight = 2 + }, + new + { + Id = 32, + Cost = 2, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 4, + Name = "Whip", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 3 + }, + new + { + Id = 33, + Cost = 10, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 1, + Name = "Blowgun", + RangeMeele = 5, + WeaponType = "Martial Ranged", + Weight = 1 + }, + new + { + Id = 34, + Cost = 75, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Crossbow, hand", + RangeMeele = 5, + WeaponType = "Martial Ranged", + Weight = 3 + }, + new + { + Id = 35, + Cost = 50, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 10, + Name = "Crossbow, heavy", + RangeMeele = 5, + WeaponType = "Martial Ranged", + Weight = 18 + }, + new + { + Id = 36, + Cost = 50, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Longbow", + RangeMeele = 5, + WeaponType = "Martial Ranged", + Weight = 2 + }, + new + { + Id = 37, + Cost = 1, + CurrencyType = 3, + Description = "A Large or smaller creature hit by a net is restrained until it is freed. A net has no effect on creatures that are formless, or creatures that are Huge or larger. A creature can use its action to make a DC 10 Strength check, freeing itself or another creature within its reach on a success. Dealing 5 slashing damage to the net (AC 10) also frees the creature without harming it, ending the effect and destroying the net. When you use an action, bonus action, or reaction to attack with a net, you can make only one attack regardless of the number of attacks you can normally make.", + DiceCount = 1, + DiceValue = 0, + Name = "Net", + RangeMeele = 5, + RangeThrowLong = 15, + RangeThrowNormal = 5, + WeaponType = "Martial Ranged", + Weight = 3 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Wisdom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("AnimalHandling") + .HasColumnType("int"); + + b.Property("CanAnimalHandling") + .HasColumnType("bit"); + + b.Property("CanInsight") + .HasColumnType("bit"); + + b.Property("CanMedicine") + .HasColumnType("bit"); + + b.Property("CanPerception") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CanSurvival") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Insight") + .HasColumnType("int"); + + b.Property("Medicine") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("Perception") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Survival") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Wisdoms"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Biography", b => + { + b.HasOne("SessionCompanion.Database.Tables.Alignment", "Alignment") + .WithMany("Biography") + .HasForeignKey("AlignmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Background", "Background") + .WithMany("Biography") + .HasForeignKey("BackgroundId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Biography") + .HasForeignKey("SessionCompanion.Database.Tables.Biography", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Class", "Class") + .WithMany("Biography") + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Race", "Race") + .WithMany("Biography") + .HasForeignKey("RaceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alignment"); + + b.Navigation("Background"); + + b.Navigation("Character"); + + b.Navigation("Class"); + + b.Navigation("Race"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b => + { + b.HasOne("SessionCompanion.Database.Tables.User", "User") + .WithMany("Character") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterArmor", b => + { + b.HasOne("SessionCompanion.Database.Tables.Armor", "Armor") + .WithMany("CharacterArmors") + .HasForeignKey("ArmorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Armor"); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterOtherEquipment", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.OtherEquipment", "OtherEquipment") + .WithMany("CharacterOtherEquipments") + .HasForeignKey("OtherEquipmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + + b.Navigation("OtherEquipment"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterWeapon", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Weapon", "Weapon") + .WithMany("CharacterWeapons") + .HasForeignKey("WeaponId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + + b.Navigation("Weapon"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Charisma", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Charisma") + .HasForeignKey("SessionCompanion.Database.Tables.Charisma", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Constitution", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Constitution") + .HasForeignKey("SessionCompanion.Database.Tables.Constitution", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Dexterity", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Dexterity") + .HasForeignKey("SessionCompanion.Database.Tables.Dexterity", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Intelligence", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Intelligence") + .HasForeignKey("SessionCompanion.Database.Tables.Intelligence", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Statistics", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Statistics") + .HasForeignKey("SessionCompanion.Database.Tables.Statistics", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Strength", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Strength") + .HasForeignKey("SessionCompanion.Database.Tables.Strength", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Wisdom", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Wisdom") + .HasForeignKey("SessionCompanion.Database.Tables.Wisdom", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Alignment", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Armor", b => + { + b.Navigation("CharacterArmors"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Background", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b => + { + b.Navigation("Biography"); + + b.Navigation("Charisma"); + + b.Navigation("Constitution"); + + b.Navigation("Dexterity"); + + b.Navigation("Intelligence"); + + b.Navigation("Statistics"); + + b.Navigation("Strength"); + + b.Navigation("Wisdom"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Class", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.OtherEquipment", b => + { + b.Navigation("CharacterOtherEquipments"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Race", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.User", b => + { + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Weapon", b => + { + b.Navigation("CharacterWeapons"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Migrations/20210102163136_weapons-added.cs b/SessionCompanion/SessionCompanion.Database/Migrations/20210102163136_weapons-added.cs new file mode 100644 index 0000000..44d491f --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Migrations/20210102163136_weapons-added.cs @@ -0,0 +1,480 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace SessionCompanion.Database.Migrations +{ + public partial class weaponsadded : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Armors", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(max)", nullable: true), + Category = table.Column(type: "nvarchar(max)", nullable: true), + ArmorClassBase = table.Column(type: "nvarchar(max)", nullable: true), + HaveDexterityBonus = table.Column(type: "bit", nullable: false), + MinimumStrength = table.Column(type: "int", nullable: true), + HaveStealthDisadvantage = table.Column(type: "bit", nullable: false), + Weight = table.Column(type: "int", nullable: false), + Cost = table.Column(type: "int", nullable: false), + CurrencyType = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Armors", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "OtherEquipment", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(max)", nullable: true), + Description = table.Column(type: "nvarchar(max)", nullable: true), + Cost = table.Column(type: "int", nullable: false), + CurrencyType = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_OtherEquipment", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Weapons", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(max)", nullable: true), + Cost = table.Column(type: "int", nullable: false), + Weight = table.Column(type: "int", nullable: false), + CurrencyType = table.Column(type: "int", nullable: false), + DiceCount = table.Column(type: "int", nullable: false), + DiceValue = table.Column(type: "int", nullable: false), + TwoHandDiceCount = table.Column(type: "int", nullable: true), + TwoHandDiceValue = table.Column(type: "int", nullable: true), + TwoHandDamageType = table.Column(type: "nvarchar(max)", nullable: true), + Description = table.Column(type: "nvarchar(max)", nullable: true), + WeaponType = table.Column(type: "nvarchar(max)", nullable: true), + RangeMeele = table.Column(type: "int", nullable: false), + RangeThrowNormal = table.Column(type: "int", nullable: true), + RangeThrowLong = table.Column(type: "int", nullable: true), + RangeLong = table.Column(type: "int", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Weapons", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "CharacterArmors", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CharacterId = table.Column(type: "int", nullable: false), + ArmorId = table.Column(type: "int", nullable: false), + InUse = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CharacterArmors", x => x.Id); + table.ForeignKey( + name: "FK_CharacterArmors_Armors_ArmorId", + column: x => x.ArmorId, + principalTable: "Armors", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_CharacterArmors_Characters_CharacterId", + column: x => x.CharacterId, + principalTable: "Characters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "CharacterOtherEquipment", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CharacterId = table.Column(type: "int", nullable: false), + OtherEquipmentId = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CharacterOtherEquipment", x => x.Id); + table.ForeignKey( + name: "FK_CharacterOtherEquipment_Characters_CharacterId", + column: x => x.CharacterId, + principalTable: "Characters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_CharacterOtherEquipment_OtherEquipment_OtherEquipmentId", + column: x => x.OtherEquipmentId, + principalTable: "OtherEquipment", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "CharacterWeapons", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + CharacterId = table.Column(type: "int", nullable: false), + WeaponId = table.Column(type: "int", nullable: false), + InUse = table.Column(type: "bit", nullable: false), + HoldInRightHand = table.Column(type: "bit", nullable: false), + HoldInLeftHand = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CharacterWeapons", x => x.Id); + table.ForeignKey( + name: "FK_CharacterWeapons_Characters_CharacterId", + column: x => x.CharacterId, + principalTable: "Characters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_CharacterWeapons_Weapons_WeaponId", + column: x => x.WeaponId, + principalTable: "Weapons", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.InsertData( + table: "Armors", + columns: new[] { "Id", "ArmorClassBase", "Category", "Cost", "CurrencyType", "HaveDexterityBonus", "HaveStealthDisadvantage", "MinimumStrength", "Name", "Weight" }, + values: new object[,] + { + { 1, "11", "Light", 5, 3, true, true, 0, "Padded", 8 }, + { 13, "2", "Shield", 10, 3, false, false, 0, "Shield", 6 }, + { 12, "18", "Heavy", 1500, 3, false, true, 15, "Plate", 65 }, + { 11, "17", "Heavy", 200, 3, false, true, 15, "Splint", 60 }, + { 9, "14", "Heavy", 30, 3, false, true, 0, "Ring Mail", 40 }, + { 8, "15", "Medium", 750, 3, true, true, 0, "Half Plate", 40 }, + { 10, "16", "Heavy", 75, 3, false, true, 13, "Chain Mail", 55 }, + { 6, "14", "Medium", 50, 3, true, true, 0, "Scale Mail", 45 }, + { 5, "13", "Medium", 50, 3, true, false, 0, "Chain Shirt", 20 }, + { 4, "12", "Medium", 10, 3, true, false, 0, "Hide", 12 }, + { 3, "12", "Light", 45, 3, true, false, 0, "Studded Leather", 13 }, + { 2, "11", "Light", 10, 3, true, false, 0, "Leather", 10 }, + { 7, "14", "Medium", 400, 3, true, false, 0, "Breastplate", 20 } + }); + + migrationBuilder.InsertData( + table: "OtherEquipment", + columns: new[] { "Id", "Cost", "CurrencyType", "Description", "Name" }, + values: new object[,] + { + { 92, 5, 0, "", "Signal whistle" }, + { 88, 1, 0, "", "Sack" }, + { 89, 5, 3, " A scale includes a small balance, pans, and a suitable assortment of weights up to 2 pounds. With it, you can measure the exact weight of small objects, such as raw precious metals or trade goods, to help determine their worth.", "Scale, merchant's" }, + { 90, 5, 1, "", "Sealing wax" }, + { 91, 2, 3, "", "Shovel" }, + { 93, 5, 3, "", "Signet ring" }, + { 100, 1, 0, " A torch burns for 1 hour, providing bright light in a 20-foot radius and dim light for an additional 20 feet. If you make a melee attack with a burning torch and hit, it deals 1 fire damage.", "Torch" }, + { 95, 50, 3, " Essential for wizards, a spellbook is a leather-bound tome with 100 blank vellum pages suitable for recording spells.", "Spellbook" }, + { 96, 1, 1, "", "Spike, iron" }, + { 97, 1000, 3, " Objects viewed through a spyglass are magnified to twice their size.", "Spyglass" }, + { 98, 2, 3, " A simple and portable canvas shelter, a tent sleeps two.", "Tent, two-person" }, + { 99, 5, 1, " This small container holds flint, fire steel, and tinder (usually dry cloth soaked in light oil) used to kindle a fire. Using it to light a torch--or anything else with abundant, exposed fuel--takes an action. Lighting any other fire takes 1 minute.", "Tinderbox" }, + { 87, 10, 3, " Rope, whether made of hemp or silk, has 2 hit points and can be burst with a DC 17 Strength check.", "Rope, silk (50 feet)" }, + { 94, 2, 0, "", "Soap" }, + { 86, 1, 3, " Rope, whether made of hemp or silk, has 2 hit points and can be burst with a DC 17 Strength check.", "Rope, hempen (50 feet)" }, + { 79, 50, 3, " A character who drinks the magical red fluid in this vial regains 2d4 + 2 hit points. Drinking or administering a potion takes an action.", "Potion of healing" }, + { 84, 5, 3, " A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.", "Reliquary" }, + { 83, 5, 1, " Rations consist of dry foods suitable for extended travel, including jerky, dried fruit, hardtack, and nuts.", "Rations (1 day)" }, + { 82, 4, 3, " You can use a portable ram to break down doors. When doing so, you gain a +4 bonus on the Strength check. One other character can help you use the ram, giving you advantage on this check.", "Ram, portable" }, + { 81, 1, 3, " A quiver can hold up to 20 arrows.", "Quiver" }, + { 101, 1, 3, "", "Vial" }, + { 78, 2, 3, "", "Pot, iron" }, + { 77, 5, 0, "", "Pole (10-foot)" }, + { 76, 100, 3, " You can use the poison in this vial to coat one slashing or piercing weapon or up to three pieces of ammunition. Applying the poison takes an action. A creature hit by the poisoned weapon or ammunition must make a DC 10 Constitution saving throw or take 1d4 poison damage. Once applied, the poison retains potency for 1 minute before drying.", "Poison, basic (vial)" }, + { 75, 5, 0, "", "Piton" }, + { 74, 2, 3, "", "Pick, miner's" }, + { 73, 5, 3, "", "Perfume (vial)" }, + { 72, 1, 1, "", "Parchment (one sheet)" }, + { 71, 2, 1, "", "Paper (one sheet)" } + }); + + migrationBuilder.InsertData( + table: "OtherEquipment", + columns: new[] { "Id", "Cost", "CurrencyType", "Description", "Name" }, + values: new object[,] + { + { 70, 1, 1, " Oil usually comes in a clay flask that holds 1 pint. As an action, you can splash the oil in this flask onto a creature within 5 feet of you or throw it up to 20 feet, shattering it on impact. Make a ranged attack against a target creature or object, treating the oil as an improvised weapon. On a hit, the target is covered in oil. If the target takes any fire damage before the oil dries (after 1 minute), the target takes an additional 5 fire damage from the burning oil. You can also pour a flask of oil on the ground to cover a 5-foot-square area, provided that the surface is level. If lit, the oil burns for 2 rounds and deals 5 fire damage to any creature that enters the area or ends its turn in the area. A creature can take this damage only once per turn.", "Oil (flask)" }, + { 85, 1, 3, "", "Robes" }, + { 102, 2, 1, "", "Waterskin" }, + { 109, 15, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Cartographer's tools" }, + { 104, 16, 3, "", "Burglar's Pack" }, + { 135, 25, 3, " This set of tools includes a small file, a set of lock picks, a small mirror mounted on a metal handle, a set of narrow-bladed scissors, and a pair of pliers. Proficiency with these tools lets you add your proficiency bonus to any ability checks you make to disarm traps or open locks.", "Thieves' tools" }, + { 134, 25, 3, " This set of instruments is used for navigation at sea. Proficiency with navigator's tools lets you chart a ship's course and follow navigation charts. In addition, these tools allow you to add your proficiency bonus to any ability check you make to avoid getting lost at sea.", "Navigator's tools" }, + { 133, 30, 3, " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", "Viol" }, + { 132, 2, 3, " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", "Shawm" }, + { 131, 12, 3, " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", "Pan flute" }, + { 130, 3, 3, " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", "Horn" }, + { 129, 30, 3, " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", "Lyre" }, + { 128, 35, 3, " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", "Lute" }, + { 127, 2, 3, " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", "Flute" }, + { 126, 25, 3, " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", "Dulcimer" }, + { 125, 6, 3, " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", "Drum" }, + { 124, 30, 3, " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", "Bagpipes" }, + { 123, 5, 1, " This item encompasses a wide range of game pieces, including dice and decks of cards (for games such as Three-Dragon Ante). A few common examples appear on the Tools table, but other kinds of gaming sets exist. If you are proficient with a gaming set, you can add your proficiency bonus to ability checks you make to play a game with that set. Each type of gaming set requires a separate proficiency.", "Playing card set" }, + { 122, 1, 1, " This item encompasses a wide range of game pieces, including dice and decks of cards (for games such as Three-Dragon Ante). A few common examples appear on the Tools table, but other kinds of gaming sets exist. If you are proficient with a gaming set, you can add your proficiency bonus to ability checks you make to play a game with that set. Each type of gaming set requires a separate proficiency.", "Dice set" }, + { 121, 1, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Woodcarver's tools" }, + { 120, 1, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Weaver's tools" }, + { 119, 50, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Tinker's tools" }, + { 105, 50, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Alchemist's supplies" }, + { 106, 20, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Brewer's supplies" }, + { 107, 10, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Calligrapher's supplies" }, + { 108, 8, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Carpenter's tools" }, + { 69, 5, 3, "", "Mirror, steel" }, + { 110, 5, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Cobbler's tools" }, + { 103, 1, 0, "", "Whetstone" }, + { 111, 1, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Cook's utensils" }, + { 113, 25, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Jeweler's tools" }, + { 114, 5, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Leatherworker's tools" }, + { 115, 10, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Mason's tools" }, + { 116, 10, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Painter's supplies" }, + { 117, 10, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Potter's tools" }, + { 118, 20, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Smith's tools" }, + { 112, 30, 3, " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", "Glassblower's tools" }, + { 68, 2, 3, " These metal restraints can bind a Small or Medium creature. Escaping the manacles requires a successful DC 20 Dexterity check. Breaking them requires a successful DC 20 Strength check. Each set of manacles comes with one key. Without the key, a creature proficient with thieves' tools can pick the manacles' lock with a successful DC 15 Dexterity check. Manacles have 15 hit points.", "Manacles" }, + { 80, 5, 1, " A cloth or leather pouch can hold up to 20 sling bullets or 50 blowgun needles, among other things. A compartmentalized pouch for holding spell components is called a component pouch (described earlier in this section).", "Pouch" }, + { 66, 10, 3, " A key is provided with the lock. Without the key, a creature proficient with thieves' tools can pick this lock with a successful DC 15 Dexterity check. Your GM may decide that better locks are available for higher prices.", "Lock" }, + { 31, 1, 0, "", "Chalk (1 piece)" }, + { 30, 5, 3, " A chain has 10 hit points. It can be burst with a successful DC 20 Strength check.", "Chain (10 feet)" } + }); + + migrationBuilder.InsertData( + table: "OtherEquipment", + columns: new[] { "Id", "Cost", "CurrencyType", "Description", "Name" }, + values: new object[,] + { + { 29, 1, 3, " This cylindrical leather case can hold up to ten rolled-up sheets of paper or five rolled-up sheets of parchment.", "Case, map or scroll" }, + { 28, 1, 3, " This wooden case can hold up to twenty crossbow bolts.", "Case, crossbow bolt" }, + { 27, 1, 0, " For 1 hour, a candle sheds bright light in a 5-foot radius and dim light for an additional 5 feet.", "Candle" }, + { 26, 5, 0, " As an action, you can spread a bag of caltrops to cover a square area that is 5 feet on a side. Any creature that enters the area must succeed on a DC 15 Dexterity saving throw or stop moving this turn and take 1 piercing damage. Taking this damage reduces the creature's walking speed by 10 feet until the creature regains at least 1 hit point. A creature moving through the area at half speed doesn't need to make the save.", "Caltrops" }, + { 25, 5, 0, "", "Bucket" }, + { 24, 2, 3, "", "Bottle, glass" }, + { 23, 25, 3, " A book might contain poetry, historical accounts, information pertaining to a particular field of lore, diagrams and notes on gnomish contraptions, or just about anything else that can be represented using text or pictures. A book of spells is a spellbook (described later in this section).", "Book" }, + { 22, 1, 3, " A set of pulleys with a cable threaded through them and a hook to attach to objects, a block and tackle allows you to hoist up to four times the weight you can normally lift.", "Block and tackle" }, + { 21, 5, 1, "", "Blanket" }, + { 20, 1, 3, "", "Bell" }, + { 19, 1, 3, "", "Bedroll" }, + { 18, 4, 1, "", "Basket" }, + { 17, 2, 3, "", "Barrel" }, + { 67, 100, 3, " This lens allows a closer look at small objects. It is also useful as a substitute for flint and steel when starting fires. Lighting a fire with a magnifying glass requires light as bright as sunlight to focus, tinder to ignite, and about 5 minutes for the fire to ignite. A magnifying glass grants advantage on any ability check made to appraise or inspect an item that is small or highly detailed.", "Magnifying glass" }, + { 15, 2, 3, "", "Backpack" }, + { 1, 2, 3, "", "Abacus" }, + { 2, 25, 3, " As an action, you can splash the contents of this vial onto a creature within 5 feet of you or throw the vial up to 20 feet, shattering it on impact. In either case, make a ranged attack against a creature or object, treating the acid as an improvised weapon. On a hit, the target takes 2d6 acid damage.", "Acid (vial)" }, + { 3, 50, 3, " This sticky, adhesive fluid ignites when exposed to air. As an action, you can throw this flask up to 20 feet, shattering it on impact. Make a ranged attack against a creature or object, treating the alchemist's fire as an improvised weapon. On a hit, the target takes 1d4 fire damage at the start of each of its turns. A creature can end this damage by using its action to make a DC 10 Dexterity check to extinguish the flames.", "Alchemist's fire (flask)" }, + { 4, 5, 0, "", "Arrow" }, + { 5, 2, 0, "", "Blowgun needle" }, + { 6, 5, 0, "", "Crossbow bolt" }, + { 32, 5, 3, "", "Chest" }, + { 7, 1, 0, "", "Sling bullet" }, + { 9, 50, 3, " A creature that drinks this vial of liquid gains advantage on saving throws against poison for 1 hour. It confers no benefit to undead or constructs.", "Antitoxin (vial)" }, + { 10, 10, 3, " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", "Crystal" }, + { 11, 20, 3, " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", "Orb" }, + { 12, 10, 3, " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", "Rod" }, + { 13, 5, 3, " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", "Staff" }, + { 14, 10, 3, " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", "Wand" }, + { 8, 5, 3, " A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.", "Amulet" }, + { 33, 5, 1, "", "Clothes, common" }, + { 16, 1, 3, " As an action, you can spill these tiny metal balls from their pouch to cover a level, square area that is 10 feet on a side. A creature moving across the covered area must succeed on a DC 10 Dexterity saving throw or fall prone. A creature moving through the area at half speed doesn't need to make the save.", "Ball bearings (bag of 1,000)" }, + { 35, 15, 3, "", "Clothes, fine" }, + { 34, 5, 3, "", "Clothes, costume" }, + { 65, 5, 3, " A hooded lantern casts bright light in a 30-foot radius and dim light for an additional 30 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil. As an action, you can lower the hood, reducing the light to dim light in a 5-foot radius.", "Lantern, hooded" }, + { 64, 10, 3, " A bullseye lantern casts bright light in a 60-foot cone and dim light for an additional 60 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil.", "Lantern, bullseye" }, + { 63, 5, 1, " A lamp casts bright light in a 15-foot radius and dim light for an additional 30 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil.", "Lamp" }, + { 62, 1, 1, "", "Ladder (10-foot)" }, + { 61, 50, 3, " A poisoner's kit includes the vials, chemicals, and other equipment necessary for the creation of poisons. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to craft or use poisons.", "Poisoner's Kit" }, + { 60, 2, 1, " This tin box contains a cup and simple cutlery. The box clamps together, and one side can be used as a cooking pan and the other as a plate or shallow bowl.", "Mess Kit" }, + { 59, 5, 3, " This kit is a leather pouch containing bandages, salves, and splints. The kit has ten uses. As an action, you can expend one use of the kit to stabilize a creature that has 0 hit points, without needing to make a Wisdom (Medicine) check.", "Healer's Kit" }, + { 57, 15, 3, " This small box contains a variety of papers and parchments, pens and inks, seals and sealing wax, gold and silver leaf, and other supplies necessary to create convincing forgeries of physical documents. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to create a physical forgery of a document.", "Forgery Kit" } + }); + + migrationBuilder.InsertData( + table: "OtherEquipment", + columns: new[] { "Id", "Cost", "CurrencyType", "Description", "Name" }, + values: new object[,] + { + { 56, 25, 3, " This pouch of cosmetics, hair dye, and small props lets you create disguises that change your physical appearance. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to create a visual disguise.", "Disguise Kit" }, + { 55, 25, 3, " A climber's kit includes special pitons, boot tips, gloves, and a harness. You can use the climber's kit as an action to anchor yourself; when you do, you can't fall more than 25 feet from the point where you anchored yourself, and you can't climb more than 25 feet away from that point without undoing the anchor.", "Climber's Kit" }, + { 54, 2, 0, "", "Jug or pitcher" }, + { 53, 2, 0, "", "Ink pen" }, + { 52, 10, 3, "", "Ink (1 ounce bottle)" }, + { 51, 5, 3, " When you use your action to set it, this trap forms a saw-toothed steel ring that snaps shut when a creature steps on a pressure plate in the center. The trap is affixed by a heavy chain to an immobile object, such as a tree or a spike driven into the ground. A creature that steps on the plate must succeed on a DC 13 Dexterity saving throw or take 1d4 piercing damage and stop moving. Thereafter, until the creature breaks free of the trap, its movement is limited by the length of the chain (typically 3 feet long). A creature can use its action to make a DC 13 Strength check, freeing itself or another creature within its reach on a success. Each failed check deals 1 piercing damage to the trapped creature.", "Hunting trap" }, + { 58, 5, 3, " This kit contains a variety of instruments such as clippers, mortar and pestle, and pouches and vials used by herbalists to create remedies and potions. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to identify or apply herbs. Also, proficiency with this kit is required to create antitoxin and potions of healing.", "Herbalism Kit" }, + { 49, 25, 3, " As an action, you can splash the contents of this flask onto a creature within 5 feet of you or throw it up to 20 feet, shattering it on impact. In either case, make a ranged attack against a target creature, treating the holy water as an improvised weapon. If the target is a fiend or undead, it takes 2d6 radiant damage. A cleric or paladin may create holy water by performing a special ritual. The ritual takes 1 hour to perform, uses 25 gp worth of powdered silver, and requires the caster to expend a 1st-level spell slot.", "Holy water (flask)" }, + { 36, 2, 3, "", "Clothes, traveler's" }, + { 50, 25, 3, "", "Hourglass" }, + { 37, 25, 3, " A component pouch is a small, watertight leather belt pouch that has compartments to hold all the material components and other special items you need to cast your spells, except for those components that have a specific cost (as indicated in a spell's description).", "Component pouch" }, + { 38, 2, 3, " Using a crowbar grants advantage to Strength checks where the crowbar's leverage can be applied.", "Crowbar" }, + { 39, 1, 3, " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", "Sprig of mistletoe" }, + { 40, 1, 3, " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", "Totem" }, + { 42, 10, 3, " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", "Yew wand" }, + { 41, 5, 3, " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", "Wooden staff" }, + { 44, 1, 3, " This kit includes a wooden rod, silken line, corkwood bobbers, steel hooks, lead sinkers, velvet lures, and narrow netting.", "Fishing tackle" }, + { 45, 2, 0, "", "Flask or tankard" }, + { 46, 2, 3, "", "Grappling hook" }, + { 47, 1, 3, "", "Hammer" }, + { 48, 2, 3, "", "Hammer, sledge" }, + { 43, 5, 3, " A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.", "Emblem" } + }); + + migrationBuilder.InsertData( + table: "Weapons", + columns: new[] { "Id", "Cost", "CurrencyType", "Description", "DiceCount", "DiceValue", "Name", "RangeLong", "RangeMeele", "RangeThrowLong", "RangeThrowNormal", "TwoHandDamageType", "TwoHandDiceCount", "TwoHandDiceValue", "WeaponType", "Weight" }, + values: new object[,] + { + { 22, 15, 3, null, 1, 8, "Longsword", null, 5, null, null, null, 1, 10, "Martial Melee", 3 }, + { 26, 25, 3, null, 1, 8, "Rapier", null, 5, null, null, null, null, null, "Martial Melee", 2 }, + { 21, 10, 3, "You have disadvantage when you use a lance to attack a target within 5 feet of you. Also, a lance requires two hands to wield when you aren�t mounted.", 1, 12, "Lance", null, 5, null, null, null, null, null, "Martial Melee", 6 }, + { 23, 10, 3, null, 2, 6, "Maul", null, 5, null, null, null, null, null, "Martial Melee", 10 }, + { 24, 15, 3, null, 1, 8, "Morningstar", null, 5, null, null, null, null, null, "Martial Melee", 4 }, + { 25, 5, 3, null, 1, 10, "Pike", null, 5, null, null, null, null, null, "Martial Melee", 18 }, + { 27, 25, 3, null, 1, 6, "Scimitar", null, 5, null, null, null, null, null, "Martial Melee", 3 }, + { 34, 75, 3, null, 1, 6, "Crossbow, hand", null, 5, null, null, null, null, null, "Martial Ranged", 3 }, + { 29, 5, 3, null, 1, 6, "Trident", null, 5, 60, 20, null, null, null, "Martial Melee", 4 }, + { 30, 5, 3, null, 1, 8, "War pick", null, 5, null, null, null, null, null, "Martial Melee", 2 }, + { 31, 15, 3, null, 1, 8, "Warhammer", null, 5, null, null, null, 1, 10, "Martial Melee", 2 }, + { 32, 2, 3, null, 1, 4, "Whip", null, 5, null, null, null, null, null, "Martial Melee", 3 }, + { 33, 10, 3, null, 1, 1, "Blowgun", null, 5, null, null, null, null, null, "Martial Ranged", 1 }, + { 20, 20, 3, null, 1, 10, "Halberd", null, 5, null, null, null, null, null, "Martial Melee", 6 }, + { 35, 50, 3, null, 1, 10, "Crossbow, heavy", null, 5, null, null, null, null, null, "Martial Ranged", 18 }, + { 28, 10, 3, null, 1, 6, "Shortsword", null, 5, null, null, null, null, null, "Martial Melee", 2 }, + { 19, 50, 3, null, 2, 6, "Greatsword", null, 5, null, null, null, null, null, "Martial Melee", 6 }, + { 3, 2, 1, null, 1, 8, "Greatclub", null, 5, null, null, null, null, null, "Simple Melee", 10 }, + { 17, 20, 3, null, 1, 10, "Glaive", null, 5, null, null, null, null, null, "Martial Melee", 6 }, + { 36, 50, 3, null, 1, 8, "Longbow", null, 5, null, null, null, null, null, "Martial Ranged", 2 } + }); + + migrationBuilder.InsertData( + table: "Weapons", + columns: new[] { "Id", "Cost", "CurrencyType", "Description", "DiceCount", "DiceValue", "Name", "RangeLong", "RangeMeele", "RangeThrowLong", "RangeThrowNormal", "TwoHandDamageType", "TwoHandDiceCount", "TwoHandDiceValue", "WeaponType", "Weight" }, + values: new object[,] + { + { 1, 1, 1, null, 1, 4, "Club", null, 5, null, null, null, null, null, "Simple Melee", 2 }, + { 2, 2, 3, null, 1, 4, "Dagger", null, 5, 60, 20, null, null, null, "Simple Melee", 1 }, + { 4, 5, 3, null, 1, 6, "Handaxe", null, 5, 60, 20, null, null, null, "Simple Melee", 2 }, + { 5, 5, 1, null, 1, 6, "Javelin", null, 5, 120, 30, null, null, null, "Simple Melee", 2 }, + { 6, 2, 3, null, 1, 4, "Light hammer", null, 5, 60, 20, null, null, null, "Simple Melee", 2 }, + { 7, 5, 3, null, 1, 6, "Mace", null, 5, null, null, null, null, null, "Simple Melee", 4 }, + { 18, 30, 3, null, 1, 12, "Greataxe", null, 5, null, null, null, null, null, "Martial Melee", 7 }, + { 8, 2, 1, null, 1, 6, "Quarterstaff", null, 5, null, null, null, 1, 8, "Simple Melee", 4 }, + { 10, 1, 3, null, 1, 4, "Spear", null, 5, 60, 20, null, 1, 8, "Simple Melee", 3 }, + { 11, 25, 3, null, 1, 8, "Crossbow, light", null, 5, null, null, null, null, null, "Simple Ranged", 5 }, + { 12, 5, 0, null, 1, 4, "Dart", null, 5, 60, 20, null, null, null, "Simple Ranged", 0 }, + { 13, 25, 3, null, 1, 6, "Shortbow", null, 5, null, null, null, null, null, "Simple Ranged", 2 }, + { 14, 1, 1, null, 1, 4, "Sling", null, 5, null, null, null, null, null, "Simple Ranged", 0 }, + { 15, 10, 3, null, 1, 8, "Battleaxe", null, 5, null, null, null, 1, 10, "Martial Melee", 4 }, + { 16, 10, 3, null, 1, 8, "Flail", null, 5, null, null, null, null, null, "Martial Melee", 2 }, + { 9, 1, 3, null, 1, 4, "Sickle", null, 5, null, null, null, null, null, "Simple Melee", 2 }, + { 37, 1, 3, "A Large or smaller creature hit by a net is restrained until it is freed. A net has no effect on creatures that are formless, or creatures that are Huge or larger. A creature can use its action to make a DC 10 Strength check, freeing itself or another creature within its reach on a success. Dealing 5 slashing damage to the net (AC 10) also frees the creature without harming it, ending the effect and destroying the net. When you use an action, bonus action, or reaction to attack with a net, you can make only one attack regardless of the number of attacks you can normally make.", 1, 0, "Net", null, 5, 15, 5, null, null, null, "Martial Ranged", 3 } + }); + + migrationBuilder.InsertData( + table: "CharacterArmors", + columns: new[] { "Id", "ArmorId", "CharacterId", "InUse" }, + values: new object[,] + { + { 1, 1, 1, true }, + { 3, 2, 2, true }, + { 6, 2, 3, false }, + { 2, 3, 1, false }, + { 4, 5, 2, false }, + { 5, 6, 3, true } + }); + + migrationBuilder.InsertData( + table: "CharacterOtherEquipment", + columns: new[] { "Id", "CharacterId", "OtherEquipmentId" }, + values: new object[,] + { + { 5, 3, 6 }, + { 4, 2, 5 }, + { 2, 1, 3 }, + { 6, 3, 2 }, + { 3, 2, 2 }, + { 1, 1, 1 } + }); + + migrationBuilder.InsertData( + table: "CharacterWeapons", + columns: new[] { "Id", "CharacterId", "HoldInLeftHand", "HoldInRightHand", "InUse", "WeaponId" }, + values: new object[,] + { + { 1, 1, false, false, false, 1 }, + { 3, 2, false, true, true, 2 }, + { 2, 1, true, false, true, 4 }, + { 7, 3, false, true, true, 7 }, + { 4, 2, false, false, false, 8 }, + { 5, 3, false, false, false, 9 } + }); + + migrationBuilder.CreateIndex( + name: "IX_CharacterArmors_ArmorId", + table: "CharacterArmors", + column: "ArmorId"); + + migrationBuilder.CreateIndex( + name: "IX_CharacterArmors_CharacterId", + table: "CharacterArmors", + column: "CharacterId"); + + migrationBuilder.CreateIndex( + name: "IX_CharacterOtherEquipment_CharacterId", + table: "CharacterOtherEquipment", + column: "CharacterId"); + + migrationBuilder.CreateIndex( + name: "IX_CharacterOtherEquipment_OtherEquipmentId", + table: "CharacterOtherEquipment", + column: "OtherEquipmentId"); + + migrationBuilder.CreateIndex( + name: "IX_CharacterWeapons_CharacterId", + table: "CharacterWeapons", + column: "CharacterId"); + + migrationBuilder.CreateIndex( + name: "IX_CharacterWeapons_WeaponId", + table: "CharacterWeapons", + column: "WeaponId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "CharacterArmors"); + + migrationBuilder.DropTable( + name: "CharacterOtherEquipment"); + + migrationBuilder.DropTable( + name: "CharacterWeapons"); + + migrationBuilder.DropTable( + name: "Armors"); + + migrationBuilder.DropTable( + name: "OtherEquipment"); + + migrationBuilder.DropTable( + name: "Weapons"); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs b/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs index e4915a1..08196da 100644 --- a/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1,4 +1,5 @@ // +using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; @@ -44,6 +45,216 @@ namespace SessionCompanion.Database.Migrations }); }); + modelBuilder.Entity("SessionCompanion.Database.Tables.Armor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("ArmorClassBase") + .HasColumnType("nvarchar(max)"); + + b.Property("Category") + .HasColumnType("nvarchar(max)"); + + b.Property("Cost") + .HasColumnType("int"); + + b.Property("CurrencyType") + .HasColumnType("int"); + + b.Property("HaveDexterityBonus") + .HasColumnType("bit"); + + b.Property("HaveStealthDisadvantage") + .HasColumnType("bit"); + + b.Property("MinimumStrength") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Weight") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Armors"); + + b.HasData( + new + { + Id = 1, + ArmorClassBase = "11", + Category = "Light", + Cost = 5, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = true, + MinimumStrength = 0, + Name = "Padded", + Weight = 8 + }, + new + { + Id = 2, + ArmorClassBase = "11", + Category = "Light", + Cost = 10, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Leather", + Weight = 10 + }, + new + { + Id = 3, + ArmorClassBase = "12", + Category = "Light", + Cost = 45, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Studded Leather", + Weight = 13 + }, + new + { + Id = 4, + ArmorClassBase = "12", + Category = "Medium", + Cost = 10, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Hide", + Weight = 12 + }, + new + { + Id = 5, + ArmorClassBase = "13", + Category = "Medium", + Cost = 50, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Chain Shirt", + Weight = 20 + }, + new + { + Id = 6, + ArmorClassBase = "14", + Category = "Medium", + Cost = 50, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = true, + MinimumStrength = 0, + Name = "Scale Mail", + Weight = 45 + }, + new + { + Id = 7, + ArmorClassBase = "14", + Category = "Medium", + Cost = 400, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Breastplate", + Weight = 20 + }, + new + { + Id = 8, + ArmorClassBase = "15", + Category = "Medium", + Cost = 750, + CurrencyType = 3, + HaveDexterityBonus = true, + HaveStealthDisadvantage = true, + MinimumStrength = 0, + Name = "Half Plate", + Weight = 40 + }, + new + { + Id = 9, + ArmorClassBase = "14", + Category = "Heavy", + Cost = 30, + CurrencyType = 3, + HaveDexterityBonus = false, + HaveStealthDisadvantage = true, + MinimumStrength = 0, + Name = "Ring Mail", + Weight = 40 + }, + new + { + Id = 10, + ArmorClassBase = "16", + Category = "Heavy", + Cost = 75, + CurrencyType = 3, + HaveDexterityBonus = false, + HaveStealthDisadvantage = true, + MinimumStrength = 13, + Name = "Chain Mail", + Weight = 55 + }, + new + { + Id = 11, + ArmorClassBase = "17", + Category = "Heavy", + Cost = 200, + CurrencyType = 3, + HaveDexterityBonus = false, + HaveStealthDisadvantage = true, + MinimumStrength = 15, + Name = "Splint", + Weight = 60 + }, + new + { + Id = 12, + ArmorClassBase = "18", + Category = "Heavy", + Cost = 1500, + CurrencyType = 3, + HaveDexterityBonus = false, + HaveStealthDisadvantage = true, + MinimumStrength = 15, + Name = "Plate", + Weight = 65 + }, + new + { + Id = 13, + ArmorClassBase = "2", + Category = "Shield", + Cost = 10, + CurrencyType = 3, + HaveDexterityBonus = false, + HaveStealthDisadvantage = false, + MinimumStrength = 0, + Name = "Shield", + Weight = 6 + }); + }); + modelBuilder.Entity("SessionCompanion.Database.Tables.Background", b => { b.Property("Id") @@ -183,6 +394,222 @@ namespace SessionCompanion.Database.Migrations }); }); + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterArmor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("ArmorId") + .HasColumnType("int"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("InUse") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("ArmorId"); + + b.HasIndex("CharacterId"); + + b.ToTable("CharacterArmors"); + + b.HasData( + new + { + Id = 1, + ArmorId = 1, + CharacterId = 1, + InUse = true + }, + new + { + Id = 2, + ArmorId = 3, + CharacterId = 1, + InUse = false + }, + new + { + Id = 3, + ArmorId = 2, + CharacterId = 2, + InUse = true + }, + new + { + Id = 4, + ArmorId = 5, + CharacterId = 2, + InUse = false + }, + new + { + Id = 5, + ArmorId = 6, + CharacterId = 3, + InUse = true + }, + new + { + Id = 6, + ArmorId = 2, + CharacterId = 3, + InUse = false + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterOtherEquipment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("OtherEquipmentId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("OtherEquipmentId"); + + b.ToTable("CharacterOtherEquipment"); + + b.HasData( + new + { + Id = 1, + CharacterId = 1, + OtherEquipmentId = 1 + }, + new + { + Id = 2, + CharacterId = 1, + OtherEquipmentId = 3 + }, + new + { + Id = 3, + CharacterId = 2, + OtherEquipmentId = 2 + }, + new + { + Id = 4, + CharacterId = 2, + OtherEquipmentId = 5 + }, + new + { + Id = 5, + CharacterId = 3, + OtherEquipmentId = 6 + }, + new + { + Id = 6, + CharacterId = 3, + OtherEquipmentId = 2 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterWeapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("HoldInLeftHand") + .HasColumnType("bit"); + + b.Property("HoldInRightHand") + .HasColumnType("bit"); + + b.Property("InUse") + .HasColumnType("bit"); + + b.Property("WeaponId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId"); + + b.HasIndex("WeaponId"); + + b.ToTable("CharacterWeapons"); + + b.HasData( + new + { + Id = 1, + CharacterId = 1, + HoldInLeftHand = false, + HoldInRightHand = false, + InUse = false, + WeaponId = 1 + }, + new + { + Id = 2, + CharacterId = 1, + HoldInLeftHand = true, + HoldInRightHand = false, + InUse = true, + WeaponId = 4 + }, + new + { + Id = 3, + CharacterId = 2, + HoldInLeftHand = false, + HoldInRightHand = true, + InUse = true, + WeaponId = 2 + }, + new + { + Id = 4, + CharacterId = 2, + HoldInLeftHand = false, + HoldInRightHand = false, + InUse = false, + WeaponId = 8 + }, + new + { + Id = 5, + CharacterId = 3, + HoldInLeftHand = false, + HoldInRightHand = false, + InUse = false, + WeaponId = 9 + }, + new + { + Id = 7, + CharacterId = 3, + HoldInLeftHand = false, + HoldInRightHand = true, + InUse = true, + WeaponId = 7 + }); + }); + modelBuilder.Entity("SessionCompanion.Database.Tables.Charisma", b => { b.Property("Id") @@ -407,6 +834,1112 @@ namespace SessionCompanion.Database.Migrations b.ToTable("Intelligences"); }); + modelBuilder.Entity("SessionCompanion.Database.Tables.OtherEquipment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Cost") + .HasColumnType("int"); + + b.Property("CurrencyType") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("OtherEquipment"); + + b.HasData( + new + { + Id = 1, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Abacus" + }, + new + { + Id = 2, + Cost = 25, + CurrencyType = 3, + Description = " As an action, you can splash the contents of this vial onto a creature within 5 feet of you or throw the vial up to 20 feet, shattering it on impact. In either case, make a ranged attack against a creature or object, treating the acid as an improvised weapon. On a hit, the target takes 2d6 acid damage.", + Name = "Acid (vial)" + }, + new + { + Id = 3, + Cost = 50, + CurrencyType = 3, + Description = " This sticky, adhesive fluid ignites when exposed to air. As an action, you can throw this flask up to 20 feet, shattering it on impact. Make a ranged attack against a creature or object, treating the alchemist's fire as an improvised weapon. On a hit, the target takes 1d4 fire damage at the start of each of its turns. A creature can end this damage by using its action to make a DC 10 Dexterity check to extinguish the flames.", + Name = "Alchemist's fire (flask)" + }, + new + { + Id = 4, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Arrow" + }, + new + { + Id = 5, + Cost = 2, + CurrencyType = 0, + Description = "", + Name = "Blowgun needle" + }, + new + { + Id = 6, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Crossbow bolt" + }, + new + { + Id = 7, + Cost = 1, + CurrencyType = 0, + Description = "", + Name = "Sling bullet" + }, + new + { + Id = 8, + Cost = 5, + CurrencyType = 3, + Description = " A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.", + Name = "Amulet" + }, + new + { + Id = 9, + Cost = 50, + CurrencyType = 3, + Description = " A creature that drinks this vial of liquid gains advantage on saving throws against poison for 1 hour. It confers no benefit to undead or constructs.", + Name = "Antitoxin (vial)" + }, + new + { + Id = 10, + Cost = 10, + CurrencyType = 3, + Description = " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", + Name = "Crystal" + }, + new + { + Id = 11, + Cost = 20, + CurrencyType = 3, + Description = " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", + Name = "Orb" + }, + new + { + Id = 12, + Cost = 10, + CurrencyType = 3, + Description = " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", + Name = "Rod" + }, + new + { + Id = 13, + Cost = 5, + CurrencyType = 3, + Description = " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", + Name = "Staff" + }, + new + { + Id = 14, + Cost = 10, + CurrencyType = 3, + Description = " An arcane focus is a special item--an orb, a crystal, a rod, a specially constructed staff, a wand-like length of wood, or some similar item--designed to channel the power of arcane spells. A sorcerer, warlock, or wizard can use such an item as a spellcasting focus.", + Name = "Wand" + }, + new + { + Id = 15, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Backpack" + }, + new + { + Id = 16, + Cost = 1, + CurrencyType = 3, + Description = " As an action, you can spill these tiny metal balls from their pouch to cover a level, square area that is 10 feet on a side. A creature moving across the covered area must succeed on a DC 10 Dexterity saving throw or fall prone. A creature moving through the area at half speed doesn't need to make the save.", + Name = "Ball bearings (bag of 1,000)" + }, + new + { + Id = 17, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Barrel" + }, + new + { + Id = 18, + Cost = 4, + CurrencyType = 1, + Description = "", + Name = "Basket" + }, + new + { + Id = 19, + Cost = 1, + CurrencyType = 3, + Description = "", + Name = "Bedroll" + }, + new + { + Id = 20, + Cost = 1, + CurrencyType = 3, + Description = "", + Name = "Bell" + }, + new + { + Id = 21, + Cost = 5, + CurrencyType = 1, + Description = "", + Name = "Blanket" + }, + new + { + Id = 22, + Cost = 1, + CurrencyType = 3, + Description = " A set of pulleys with a cable threaded through them and a hook to attach to objects, a block and tackle allows you to hoist up to four times the weight you can normally lift.", + Name = "Block and tackle" + }, + new + { + Id = 23, + Cost = 25, + CurrencyType = 3, + Description = " A book might contain poetry, historical accounts, information pertaining to a particular field of lore, diagrams and notes on gnomish contraptions, or just about anything else that can be represented using text or pictures. A book of spells is a spellbook (described later in this section).", + Name = "Book" + }, + new + { + Id = 24, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Bottle, glass" + }, + new + { + Id = 25, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Bucket" + }, + new + { + Id = 26, + Cost = 5, + CurrencyType = 0, + Description = " As an action, you can spread a bag of caltrops to cover a square area that is 5 feet on a side. Any creature that enters the area must succeed on a DC 15 Dexterity saving throw or stop moving this turn and take 1 piercing damage. Taking this damage reduces the creature's walking speed by 10 feet until the creature regains at least 1 hit point. A creature moving through the area at half speed doesn't need to make the save.", + Name = "Caltrops" + }, + new + { + Id = 27, + Cost = 1, + CurrencyType = 0, + Description = " For 1 hour, a candle sheds bright light in a 5-foot radius and dim light for an additional 5 feet.", + Name = "Candle" + }, + new + { + Id = 28, + Cost = 1, + CurrencyType = 3, + Description = " This wooden case can hold up to twenty crossbow bolts.", + Name = "Case, crossbow bolt" + }, + new + { + Id = 29, + Cost = 1, + CurrencyType = 3, + Description = " This cylindrical leather case can hold up to ten rolled-up sheets of paper or five rolled-up sheets of parchment.", + Name = "Case, map or scroll" + }, + new + { + Id = 30, + Cost = 5, + CurrencyType = 3, + Description = " A chain has 10 hit points. It can be burst with a successful DC 20 Strength check.", + Name = "Chain (10 feet)" + }, + new + { + Id = 31, + Cost = 1, + CurrencyType = 0, + Description = "", + Name = "Chalk (1 piece)" + }, + new + { + Id = 32, + Cost = 5, + CurrencyType = 3, + Description = "", + Name = "Chest" + }, + new + { + Id = 33, + Cost = 5, + CurrencyType = 1, + Description = "", + Name = "Clothes, common" + }, + new + { + Id = 34, + Cost = 5, + CurrencyType = 3, + Description = "", + Name = "Clothes, costume" + }, + new + { + Id = 35, + Cost = 15, + CurrencyType = 3, + Description = "", + Name = "Clothes, fine" + }, + new + { + Id = 36, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Clothes, traveler's" + }, + new + { + Id = 37, + Cost = 25, + CurrencyType = 3, + Description = " A component pouch is a small, watertight leather belt pouch that has compartments to hold all the material components and other special items you need to cast your spells, except for those components that have a specific cost (as indicated in a spell's description).", + Name = "Component pouch" + }, + new + { + Id = 38, + Cost = 2, + CurrencyType = 3, + Description = " Using a crowbar grants advantage to Strength checks where the crowbar's leverage can be applied.", + Name = "Crowbar" + }, + new + { + Id = 39, + Cost = 1, + CurrencyType = 3, + Description = " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", + Name = "Sprig of mistletoe" + }, + new + { + Id = 40, + Cost = 1, + CurrencyType = 3, + Description = " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", + Name = "Totem" + }, + new + { + Id = 41, + Cost = 5, + CurrencyType = 3, + Description = " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", + Name = "Wooden staff" + }, + new + { + Id = 42, + Cost = 10, + CurrencyType = 3, + Description = " A druidic focus might be a sprig of mistletoe or holly, a wand or scepter made of yew or another special wood, a staff drawn whole out of a living tree, or a totem object incorporating feathers, fur, bones, and teeth from sacred animals. A druid can use such an object as a spellcasting focus.", + Name = "Yew wand" + }, + new + { + Id = 43, + Cost = 5, + CurrencyType = 3, + Description = " A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.", + Name = "Emblem" + }, + new + { + Id = 44, + Cost = 1, + CurrencyType = 3, + Description = " This kit includes a wooden rod, silken line, corkwood bobbers, steel hooks, lead sinkers, velvet lures, and narrow netting.", + Name = "Fishing tackle" + }, + new + { + Id = 45, + Cost = 2, + CurrencyType = 0, + Description = "", + Name = "Flask or tankard" + }, + new + { + Id = 46, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Grappling hook" + }, + new + { + Id = 47, + Cost = 1, + CurrencyType = 3, + Description = "", + Name = "Hammer" + }, + new + { + Id = 48, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Hammer, sledge" + }, + new + { + Id = 49, + Cost = 25, + CurrencyType = 3, + Description = " As an action, you can splash the contents of this flask onto a creature within 5 feet of you or throw it up to 20 feet, shattering it on impact. In either case, make a ranged attack against a target creature, treating the holy water as an improvised weapon. If the target is a fiend or undead, it takes 2d6 radiant damage. A cleric or paladin may create holy water by performing a special ritual. The ritual takes 1 hour to perform, uses 25 gp worth of powdered silver, and requires the caster to expend a 1st-level spell slot.", + Name = "Holy water (flask)" + }, + new + { + Id = 50, + Cost = 25, + CurrencyType = 3, + Description = "", + Name = "Hourglass" + }, + new + { + Id = 51, + Cost = 5, + CurrencyType = 3, + Description = " When you use your action to set it, this trap forms a saw-toothed steel ring that snaps shut when a creature steps on a pressure plate in the center. The trap is affixed by a heavy chain to an immobile object, such as a tree or a spike driven into the ground. A creature that steps on the plate must succeed on a DC 13 Dexterity saving throw or take 1d4 piercing damage and stop moving. Thereafter, until the creature breaks free of the trap, its movement is limited by the length of the chain (typically 3 feet long). A creature can use its action to make a DC 13 Strength check, freeing itself or another creature within its reach on a success. Each failed check deals 1 piercing damage to the trapped creature.", + Name = "Hunting trap" + }, + new + { + Id = 52, + Cost = 10, + CurrencyType = 3, + Description = "", + Name = "Ink (1 ounce bottle)" + }, + new + { + Id = 53, + Cost = 2, + CurrencyType = 0, + Description = "", + Name = "Ink pen" + }, + new + { + Id = 54, + Cost = 2, + CurrencyType = 0, + Description = "", + Name = "Jug or pitcher" + }, + new + { + Id = 55, + Cost = 25, + CurrencyType = 3, + Description = " A climber's kit includes special pitons, boot tips, gloves, and a harness. You can use the climber's kit as an action to anchor yourself; when you do, you can't fall more than 25 feet from the point where you anchored yourself, and you can't climb more than 25 feet away from that point without undoing the anchor.", + Name = "Climber's Kit" + }, + new + { + Id = 56, + Cost = 25, + CurrencyType = 3, + Description = " This pouch of cosmetics, hair dye, and small props lets you create disguises that change your physical appearance. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to create a visual disguise.", + Name = "Disguise Kit" + }, + new + { + Id = 57, + Cost = 15, + CurrencyType = 3, + Description = " This small box contains a variety of papers and parchments, pens and inks, seals and sealing wax, gold and silver leaf, and other supplies necessary to create convincing forgeries of physical documents. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to create a physical forgery of a document.", + Name = "Forgery Kit" + }, + new + { + Id = 58, + Cost = 5, + CurrencyType = 3, + Description = " This kit contains a variety of instruments such as clippers, mortar and pestle, and pouches and vials used by herbalists to create remedies and potions. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to identify or apply herbs. Also, proficiency with this kit is required to create antitoxin and potions of healing.", + Name = "Herbalism Kit" + }, + new + { + Id = 59, + Cost = 5, + CurrencyType = 3, + Description = " This kit is a leather pouch containing bandages, salves, and splints. The kit has ten uses. As an action, you can expend one use of the kit to stabilize a creature that has 0 hit points, without needing to make a Wisdom (Medicine) check.", + Name = "Healer's Kit" + }, + new + { + Id = 60, + Cost = 2, + CurrencyType = 1, + Description = " This tin box contains a cup and simple cutlery. The box clamps together, and one side can be used as a cooking pan and the other as a plate or shallow bowl.", + Name = "Mess Kit" + }, + new + { + Id = 61, + Cost = 50, + CurrencyType = 3, + Description = " A poisoner's kit includes the vials, chemicals, and other equipment necessary for the creation of poisons. Proficiency with this kit lets you add your proficiency bonus to any ability checks you make to craft or use poisons.", + Name = "Poisoner's Kit" + }, + new + { + Id = 62, + Cost = 1, + CurrencyType = 1, + Description = "", + Name = "Ladder (10-foot)" + }, + new + { + Id = 63, + Cost = 5, + CurrencyType = 1, + Description = " A lamp casts bright light in a 15-foot radius and dim light for an additional 30 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil.", + Name = "Lamp" + }, + new + { + Id = 64, + Cost = 10, + CurrencyType = 3, + Description = " A bullseye lantern casts bright light in a 60-foot cone and dim light for an additional 60 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil.", + Name = "Lantern, bullseye" + }, + new + { + Id = 65, + Cost = 5, + CurrencyType = 3, + Description = " A hooded lantern casts bright light in a 30-foot radius and dim light for an additional 30 feet. Once lit, it burns for 6 hours on a flask (1 pint) of oil. As an action, you can lower the hood, reducing the light to dim light in a 5-foot radius.", + Name = "Lantern, hooded" + }, + new + { + Id = 66, + Cost = 10, + CurrencyType = 3, + Description = " A key is provided with the lock. Without the key, a creature proficient with thieves' tools can pick this lock with a successful DC 15 Dexterity check. Your GM may decide that better locks are available for higher prices.", + Name = "Lock" + }, + new + { + Id = 67, + Cost = 100, + CurrencyType = 3, + Description = " This lens allows a closer look at small objects. It is also useful as a substitute for flint and steel when starting fires. Lighting a fire with a magnifying glass requires light as bright as sunlight to focus, tinder to ignite, and about 5 minutes for the fire to ignite. A magnifying glass grants advantage on any ability check made to appraise or inspect an item that is small or highly detailed.", + Name = "Magnifying glass" + }, + new + { + Id = 68, + Cost = 2, + CurrencyType = 3, + Description = " These metal restraints can bind a Small or Medium creature. Escaping the manacles requires a successful DC 20 Dexterity check. Breaking them requires a successful DC 20 Strength check. Each set of manacles comes with one key. Without the key, a creature proficient with thieves' tools can pick the manacles' lock with a successful DC 15 Dexterity check. Manacles have 15 hit points.", + Name = "Manacles" + }, + new + { + Id = 69, + Cost = 5, + CurrencyType = 3, + Description = "", + Name = "Mirror, steel" + }, + new + { + Id = 70, + Cost = 1, + CurrencyType = 1, + Description = " Oil usually comes in a clay flask that holds 1 pint. As an action, you can splash the oil in this flask onto a creature within 5 feet of you or throw it up to 20 feet, shattering it on impact. Make a ranged attack against a target creature or object, treating the oil as an improvised weapon. On a hit, the target is covered in oil. If the target takes any fire damage before the oil dries (after 1 minute), the target takes an additional 5 fire damage from the burning oil. You can also pour a flask of oil on the ground to cover a 5-foot-square area, provided that the surface is level. If lit, the oil burns for 2 rounds and deals 5 fire damage to any creature that enters the area or ends its turn in the area. A creature can take this damage only once per turn.", + Name = "Oil (flask)" + }, + new + { + Id = 71, + Cost = 2, + CurrencyType = 1, + Description = "", + Name = "Paper (one sheet)" + }, + new + { + Id = 72, + Cost = 1, + CurrencyType = 1, + Description = "", + Name = "Parchment (one sheet)" + }, + new + { + Id = 73, + Cost = 5, + CurrencyType = 3, + Description = "", + Name = "Perfume (vial)" + }, + new + { + Id = 74, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Pick, miner's" + }, + new + { + Id = 75, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Piton" + }, + new + { + Id = 76, + Cost = 100, + CurrencyType = 3, + Description = " You can use the poison in this vial to coat one slashing or piercing weapon or up to three pieces of ammunition. Applying the poison takes an action. A creature hit by the poisoned weapon or ammunition must make a DC 10 Constitution saving throw or take 1d4 poison damage. Once applied, the poison retains potency for 1 minute before drying.", + Name = "Poison, basic (vial)" + }, + new + { + Id = 77, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Pole (10-foot)" + }, + new + { + Id = 78, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Pot, iron" + }, + new + { + Id = 79, + Cost = 50, + CurrencyType = 3, + Description = " A character who drinks the magical red fluid in this vial regains 2d4 + 2 hit points. Drinking or administering a potion takes an action.", + Name = "Potion of healing" + }, + new + { + Id = 80, + Cost = 5, + CurrencyType = 1, + Description = " A cloth or leather pouch can hold up to 20 sling bullets or 50 blowgun needles, among other things. A compartmentalized pouch for holding spell components is called a component pouch (described earlier in this section).", + Name = "Pouch" + }, + new + { + Id = 81, + Cost = 1, + CurrencyType = 3, + Description = " A quiver can hold up to 20 arrows.", + Name = "Quiver" + }, + new + { + Id = 82, + Cost = 4, + CurrencyType = 3, + Description = " You can use a portable ram to break down doors. When doing so, you gain a +4 bonus on the Strength check. One other character can help you use the ram, giving you advantage on this check.", + Name = "Ram, portable" + }, + new + { + Id = 83, + Cost = 5, + CurrencyType = 1, + Description = " Rations consist of dry foods suitable for extended travel, including jerky, dried fruit, hardtack, and nuts.", + Name = "Rations (1 day)" + }, + new + { + Id = 84, + Cost = 5, + CurrencyType = 3, + Description = " A holy symbol is a representation of a god or pantheon. It might be an amulet depicting a symbol representing a deity, the same symbol carefully engraved or inlaid as an emblem on a shield, or a tiny box holding a fragment of a sacred relic. Appendix B lists the symbols commonly associated with many gods in the multiverse. A cleric or paladin can use a holy symbol as a spellcasting focus. To use the symbol in this way, the caster must hold it in hand, wear it visibly, or bear it on a shield.", + Name = "Reliquary" + }, + new + { + Id = 85, + Cost = 1, + CurrencyType = 3, + Description = "", + Name = "Robes" + }, + new + { + Id = 86, + Cost = 1, + CurrencyType = 3, + Description = " Rope, whether made of hemp or silk, has 2 hit points and can be burst with a DC 17 Strength check.", + Name = "Rope, hempen (50 feet)" + }, + new + { + Id = 87, + Cost = 10, + CurrencyType = 3, + Description = " Rope, whether made of hemp or silk, has 2 hit points and can be burst with a DC 17 Strength check.", + Name = "Rope, silk (50 feet)" + }, + new + { + Id = 88, + Cost = 1, + CurrencyType = 0, + Description = "", + Name = "Sack" + }, + new + { + Id = 89, + Cost = 5, + CurrencyType = 3, + Description = " A scale includes a small balance, pans, and a suitable assortment of weights up to 2 pounds. With it, you can measure the exact weight of small objects, such as raw precious metals or trade goods, to help determine their worth.", + Name = "Scale, merchant's" + }, + new + { + Id = 90, + Cost = 5, + CurrencyType = 1, + Description = "", + Name = "Sealing wax" + }, + new + { + Id = 91, + Cost = 2, + CurrencyType = 3, + Description = "", + Name = "Shovel" + }, + new + { + Id = 92, + Cost = 5, + CurrencyType = 0, + Description = "", + Name = "Signal whistle" + }, + new + { + Id = 93, + Cost = 5, + CurrencyType = 3, + Description = "", + Name = "Signet ring" + }, + new + { + Id = 94, + Cost = 2, + CurrencyType = 0, + Description = "", + Name = "Soap" + }, + new + { + Id = 95, + Cost = 50, + CurrencyType = 3, + Description = " Essential for wizards, a spellbook is a leather-bound tome with 100 blank vellum pages suitable for recording spells.", + Name = "Spellbook" + }, + new + { + Id = 96, + Cost = 1, + CurrencyType = 1, + Description = "", + Name = "Spike, iron" + }, + new + { + Id = 97, + Cost = 1000, + CurrencyType = 3, + Description = " Objects viewed through a spyglass are magnified to twice their size.", + Name = "Spyglass" + }, + new + { + Id = 98, + Cost = 2, + CurrencyType = 3, + Description = " A simple and portable canvas shelter, a tent sleeps two.", + Name = "Tent, two-person" + }, + new + { + Id = 99, + Cost = 5, + CurrencyType = 1, + Description = " This small container holds flint, fire steel, and tinder (usually dry cloth soaked in light oil) used to kindle a fire. Using it to light a torch--or anything else with abundant, exposed fuel--takes an action. Lighting any other fire takes 1 minute.", + Name = "Tinderbox" + }, + new + { + Id = 100, + Cost = 1, + CurrencyType = 0, + Description = " A torch burns for 1 hour, providing bright light in a 20-foot radius and dim light for an additional 20 feet. If you make a melee attack with a burning torch and hit, it deals 1 fire damage.", + Name = "Torch" + }, + new + { + Id = 101, + Cost = 1, + CurrencyType = 3, + Description = "", + Name = "Vial" + }, + new + { + Id = 102, + Cost = 2, + CurrencyType = 1, + Description = "", + Name = "Waterskin" + }, + new + { + Id = 103, + Cost = 1, + CurrencyType = 0, + Description = "", + Name = "Whetstone" + }, + new + { + Id = 104, + Cost = 16, + CurrencyType = 3, + Description = "", + Name = "Burglar's Pack" + }, + new + { + Id = 105, + Cost = 50, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Alchemist's supplies" + }, + new + { + Id = 106, + Cost = 20, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Brewer's supplies" + }, + new + { + Id = 107, + Cost = 10, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Calligrapher's supplies" + }, + new + { + Id = 108, + Cost = 8, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Carpenter's tools" + }, + new + { + Id = 109, + Cost = 15, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Cartographer's tools" + }, + new + { + Id = 110, + Cost = 5, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Cobbler's tools" + }, + new + { + Id = 111, + Cost = 1, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Cook's utensils" + }, + new + { + Id = 112, + Cost = 30, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Glassblower's tools" + }, + new + { + Id = 113, + Cost = 25, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Jeweler's tools" + }, + new + { + Id = 114, + Cost = 5, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Leatherworker's tools" + }, + new + { + Id = 115, + Cost = 10, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Mason's tools" + }, + new + { + Id = 116, + Cost = 10, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Painter's supplies" + }, + new + { + Id = 117, + Cost = 10, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Potter's tools" + }, + new + { + Id = 118, + Cost = 20, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Smith's tools" + }, + new + { + Id = 119, + Cost = 50, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Tinker's tools" + }, + new + { + Id = 120, + Cost = 1, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Weaver's tools" + }, + new + { + Id = 121, + Cost = 1, + CurrencyType = 3, + Description = " These special tools include the items needed to pursue a craft or trade. The table shows examples of the most common types of tools, each providing items related to a single craft. Proficiency with a set of artisan's tools lets you add your proficiency bonus to any ability checks you make using the tools in your craft. Each type of artisan's tools requires a separate proficiency.", + Name = "Woodcarver's tools" + }, + new + { + Id = 122, + Cost = 1, + CurrencyType = 1, + Description = " This item encompasses a wide range of game pieces, including dice and decks of cards (for games such as Three-Dragon Ante). A few common examples appear on the Tools table, but other kinds of gaming sets exist. If you are proficient with a gaming set, you can add your proficiency bonus to ability checks you make to play a game with that set. Each type of gaming set requires a separate proficiency.", + Name = "Dice set" + }, + new + { + Id = 123, + Cost = 5, + CurrencyType = 1, + Description = " This item encompasses a wide range of game pieces, including dice and decks of cards (for games such as Three-Dragon Ante). A few common examples appear on the Tools table, but other kinds of gaming sets exist. If you are proficient with a gaming set, you can add your proficiency bonus to ability checks you make to play a game with that set. Each type of gaming set requires a separate proficiency.", + Name = "Playing card set" + }, + new + { + Id = 124, + Cost = 30, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Bagpipes" + }, + new + { + Id = 125, + Cost = 6, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Drum" + }, + new + { + Id = 126, + Cost = 25, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Dulcimer" + }, + new + { + Id = 127, + Cost = 2, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Flute" + }, + new + { + Id = 128, + Cost = 35, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Lute" + }, + new + { + Id = 129, + Cost = 30, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Lyre" + }, + new + { + Id = 130, + Cost = 3, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Horn" + }, + new + { + Id = 131, + Cost = 12, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Pan flute" + }, + new + { + Id = 132, + Cost = 2, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Shawm" + }, + new + { + Id = 133, + Cost = 30, + CurrencyType = 3, + Description = " Several of the most common types of musical instruments are shown on the table as examples. If you have proficiency with a given musical instrument, you can add your proficiency bonus to any ability checks you make to play music with the instrument. A bard can use a musical instrument as a spellcasting focus. Each type of musical instrument requires a separate proficiency.", + Name = "Viol" + }, + new + { + Id = 134, + Cost = 25, + CurrencyType = 3, + Description = " This set of instruments is used for navigation at sea. Proficiency with navigator's tools lets you chart a ship's course and follow navigation charts. In addition, these tools allow you to add your proficiency bonus to any ability check you make to avoid getting lost at sea.", + Name = "Navigator's tools" + }, + new + { + Id = 135, + Cost = 25, + CurrencyType = 3, + Description = " This set of tools includes a small file, a set of lock picks, a small mirror mounted on a metal handle, a set of narrow-bladed scissors, and a pair of pliers. Proficiency with these tools lets you add your proficiency bonus to any ability checks you make to disarm traps or open locks.", + Name = "Thieves' tools" + }); + }); + modelBuilder.Entity("SessionCompanion.Database.Tables.Race", b => { b.Property("Id") @@ -596,6 +2129,537 @@ namespace SessionCompanion.Database.Migrations }); }); + modelBuilder.Entity("SessionCompanion.Database.Tables.Weapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Cost") + .HasColumnType("int"); + + b.Property("CurrencyType") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DiceCount") + .HasColumnType("int"); + + b.Property("DiceValue") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("RangeLong") + .HasColumnType("int"); + + b.Property("RangeMeele") + .HasColumnType("int"); + + b.Property("RangeThrowLong") + .HasColumnType("int"); + + b.Property("RangeThrowNormal") + .HasColumnType("int"); + + b.Property("TwoHandDamageType") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoHandDiceCount") + .HasColumnType("int"); + + b.Property("TwoHandDiceValue") + .HasColumnType("int"); + + b.Property("WeaponType") + .HasColumnType("nvarchar(max)"); + + b.Property("Weight") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Weapons"); + + b.HasData( + new + { + Id = 1, + Cost = 1, + CurrencyType = 1, + DiceCount = 1, + DiceValue = 4, + Name = "Club", + RangeMeele = 5, + WeaponType = "Simple Melee", + Weight = 2 + }, + new + { + Id = 2, + Cost = 2, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 4, + Name = "Dagger", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + WeaponType = "Simple Melee", + Weight = 1 + }, + new + { + Id = 3, + Cost = 2, + CurrencyType = 1, + DiceCount = 1, + DiceValue = 8, + Name = "Greatclub", + RangeMeele = 5, + WeaponType = "Simple Melee", + Weight = 10 + }, + new + { + Id = 4, + Cost = 5, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Handaxe", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + WeaponType = "Simple Melee", + Weight = 2 + }, + new + { + Id = 5, + Cost = 5, + CurrencyType = 1, + DiceCount = 1, + DiceValue = 6, + Name = "Javelin", + RangeMeele = 5, + RangeThrowLong = 120, + RangeThrowNormal = 30, + WeaponType = "Simple Melee", + Weight = 2 + }, + new + { + Id = 6, + Cost = 2, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 4, + Name = "Light hammer", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + WeaponType = "Simple Melee", + Weight = 2 + }, + new + { + Id = 7, + Cost = 5, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Mace", + RangeMeele = 5, + WeaponType = "Simple Melee", + Weight = 4 + }, + new + { + Id = 8, + Cost = 2, + CurrencyType = 1, + DiceCount = 1, + DiceValue = 6, + Name = "Quarterstaff", + RangeMeele = 5, + TwoHandDiceCount = 1, + TwoHandDiceValue = 8, + WeaponType = "Simple Melee", + Weight = 4 + }, + new + { + Id = 9, + Cost = 1, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 4, + Name = "Sickle", + RangeMeele = 5, + WeaponType = "Simple Melee", + Weight = 2 + }, + new + { + Id = 10, + Cost = 1, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 4, + Name = "Spear", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + TwoHandDiceCount = 1, + TwoHandDiceValue = 8, + WeaponType = "Simple Melee", + Weight = 3 + }, + new + { + Id = 11, + Cost = 25, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Crossbow, light", + RangeMeele = 5, + WeaponType = "Simple Ranged", + Weight = 5 + }, + new + { + Id = 12, + Cost = 5, + CurrencyType = 0, + DiceCount = 1, + DiceValue = 4, + Name = "Dart", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + WeaponType = "Simple Ranged", + Weight = 0 + }, + new + { + Id = 13, + Cost = 25, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Shortbow", + RangeMeele = 5, + WeaponType = "Simple Ranged", + Weight = 2 + }, + new + { + Id = 14, + Cost = 1, + CurrencyType = 1, + DiceCount = 1, + DiceValue = 4, + Name = "Sling", + RangeMeele = 5, + WeaponType = "Simple Ranged", + Weight = 0 + }, + new + { + Id = 15, + Cost = 10, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Battleaxe", + RangeMeele = 5, + TwoHandDiceCount = 1, + TwoHandDiceValue = 10, + WeaponType = "Martial Melee", + Weight = 4 + }, + new + { + Id = 16, + Cost = 10, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Flail", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 2 + }, + new + { + Id = 17, + Cost = 20, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 10, + Name = "Glaive", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 6 + }, + new + { + Id = 18, + Cost = 30, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 12, + Name = "Greataxe", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 7 + }, + new + { + Id = 19, + Cost = 50, + CurrencyType = 3, + DiceCount = 2, + DiceValue = 6, + Name = "Greatsword", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 6 + }, + new + { + Id = 20, + Cost = 20, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 10, + Name = "Halberd", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 6 + }, + new + { + Id = 21, + Cost = 10, + CurrencyType = 3, + Description = "You have disadvantage when you use a lance to attack a target within 5 feet of you. Also, a lance requires two hands to wield when you aren�t mounted.", + DiceCount = 1, + DiceValue = 12, + Name = "Lance", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 6 + }, + new + { + Id = 22, + Cost = 15, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Longsword", + RangeMeele = 5, + TwoHandDiceCount = 1, + TwoHandDiceValue = 10, + WeaponType = "Martial Melee", + Weight = 3 + }, + new + { + Id = 23, + Cost = 10, + CurrencyType = 3, + DiceCount = 2, + DiceValue = 6, + Name = "Maul", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 10 + }, + new + { + Id = 24, + Cost = 15, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Morningstar", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 4 + }, + new + { + Id = 25, + Cost = 5, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 10, + Name = "Pike", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 18 + }, + new + { + Id = 26, + Cost = 25, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Rapier", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 2 + }, + new + { + Id = 27, + Cost = 25, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Scimitar", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 3 + }, + new + { + Id = 28, + Cost = 10, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Shortsword", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 2 + }, + new + { + Id = 29, + Cost = 5, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Trident", + RangeMeele = 5, + RangeThrowLong = 60, + RangeThrowNormal = 20, + WeaponType = "Martial Melee", + Weight = 4 + }, + new + { + Id = 30, + Cost = 5, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "War pick", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 2 + }, + new + { + Id = 31, + Cost = 15, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Warhammer", + RangeMeele = 5, + TwoHandDiceCount = 1, + TwoHandDiceValue = 10, + WeaponType = "Martial Melee", + Weight = 2 + }, + new + { + Id = 32, + Cost = 2, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 4, + Name = "Whip", + RangeMeele = 5, + WeaponType = "Martial Melee", + Weight = 3 + }, + new + { + Id = 33, + Cost = 10, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 1, + Name = "Blowgun", + RangeMeele = 5, + WeaponType = "Martial Ranged", + Weight = 1 + }, + new + { + Id = 34, + Cost = 75, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 6, + Name = "Crossbow, hand", + RangeMeele = 5, + WeaponType = "Martial Ranged", + Weight = 3 + }, + new + { + Id = 35, + Cost = 50, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 10, + Name = "Crossbow, heavy", + RangeMeele = 5, + WeaponType = "Martial Ranged", + Weight = 18 + }, + new + { + Id = 36, + Cost = 50, + CurrencyType = 3, + DiceCount = 1, + DiceValue = 8, + Name = "Longbow", + RangeMeele = 5, + WeaponType = "Martial Ranged", + Weight = 2 + }, + new + { + Id = 37, + Cost = 1, + CurrencyType = 3, + Description = "A Large or smaller creature hit by a net is restrained until it is freed. A net has no effect on creatures that are formless, or creatures that are Huge or larger. A creature can use its action to make a DC 10 Strength check, freeing itself or another creature within its reach on a success. Dealing 5 slashing damage to the net (AC 10) also frees the creature without harming it, ending the effect and destroying the net. When you use an action, bonus action, or reaction to attack with a net, you can make only one attack regardless of the number of attacks you can normally make.", + DiceCount = 1, + DiceValue = 0, + Name = "Net", + RangeMeele = 5, + RangeThrowLong = 15, + RangeThrowNormal = 5, + WeaponType = "Martial Ranged", + Weight = 3 + }); + }); + modelBuilder.Entity("SessionCompanion.Database.Tables.Wisdom", b => { b.Property("Id") @@ -710,6 +2774,63 @@ namespace SessionCompanion.Database.Migrations b.Navigation("User"); }); + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterArmor", b => + { + b.HasOne("SessionCompanion.Database.Tables.Armor", "Armor") + .WithMany("CharacterArmors") + .HasForeignKey("ArmorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Armor"); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterOtherEquipment", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.OtherEquipment", "OtherEquipment") + .WithMany("CharacterOtherEquipments") + .HasForeignKey("OtherEquipmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + + b.Navigation("OtherEquipment"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.CharacterWeapon", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Weapon", "Weapon") + .WithMany("CharacterWeapons") + .HasForeignKey("WeaponId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + + b.Navigation("Weapon"); + }); + modelBuilder.Entity("SessionCompanion.Database.Tables.Charisma", b => { b.HasOne("SessionCompanion.Database.Tables.Character", "Character") @@ -792,6 +2913,11 @@ namespace SessionCompanion.Database.Migrations b.Navigation("Biography"); }); + modelBuilder.Entity("SessionCompanion.Database.Tables.Armor", b => + { + b.Navigation("CharacterArmors"); + }); + modelBuilder.Entity("SessionCompanion.Database.Tables.Background", b => { b.Navigation("Biography"); @@ -821,6 +2947,11 @@ namespace SessionCompanion.Database.Migrations b.Navigation("Biography"); }); + modelBuilder.Entity("SessionCompanion.Database.Tables.OtherEquipment", b => + { + b.Navigation("CharacterOtherEquipments"); + }); + modelBuilder.Entity("SessionCompanion.Database.Tables.Race", b => { b.Navigation("Biography"); @@ -830,6 +2961,11 @@ namespace SessionCompanion.Database.Migrations { b.Navigation("Character"); }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Weapon", b => + { + b.Navigation("CharacterWeapons"); + }); #pragma warning restore 612, 618 } } diff --git a/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj b/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj index a157829..120ad3e 100644 --- a/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj +++ b/SessionCompanion/SessionCompanion.Database/SessionCompanion.Database.csproj @@ -21,4 +21,8 @@ + + + + From e1c42cf07fbc2bdaf6f6b68d3bed23675b058634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20G=C3=B3rzy=C5=84ski?= Date: Sat, 2 Jan 2021 17:35:30 +0100 Subject: [PATCH 23/26] SES-120 Fix typo --- .../SessionCompanion.ViewModels/Enums/CurrencyType.cs | 2 +- .../SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SessionCompanion/SessionCompanion.ViewModels/Enums/CurrencyType.cs b/SessionCompanion/SessionCompanion.ViewModels/Enums/CurrencyType.cs index 3777e97..f178afe 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/Enums/CurrencyType.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/Enums/CurrencyType.cs @@ -28,7 +28,7 @@ namespace SessionCompanion.ViewModels.Enums ep, /// - /// ZÅ‚otot + /// ZÅ‚oto /// gp, diff --git a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml index 0a8cd0b..5094690 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml +++ b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml @@ -332,7 +332,7 @@ - ZÅ‚otot + ZÅ‚oto From 9296e1713bb7e626a9ba7a8b5cd478b894d00462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sat, 2 Jan 2021 19:53:03 +0100 Subject: [PATCH 24/26] SES-124 Created ability cards --- .../ability-card/ability-card.component.css | 26 ++++++++++++++++--- .../ability-card/ability-card.component.html | 21 +++++++++------ .../ability-card.component.spec.ts | 25 ------------------ .../ability-card/ability-card.component.ts | 6 ++++- .../player-dashboard.component.html | 6 +---- .../player-dashboard.component.ts | 13 +--------- .../SessionCompanion/ClientApp/src/styles.css | 2 +- 7 files changed, 44 insertions(+), 55 deletions(-) delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.spec.ts diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css index 9f85d1b..d728057 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.css @@ -3,9 +3,29 @@ height: 480px; } #main>.mat-card{ - padding: 0px; + padding: 0; } .diagonal-line{ - width:100px; - background:linear-gradient(45deg,#ffffff 49%,#aaa 50%,#ffffff 51%); + width:50px; + background:linear-gradient(45deg,rgb(16 32 40 / 0%) 49%,black,#ffffff00 51%); +} +#ability-card-content{ + display: flex; + flex-wrap: wrap; + justify-content: space-around; + padding-top: 10px; + padding-bottom: 10px; +} +#skill-btn{ + border-color: black; + flex: 1 0 auto; + margin-bottom: 10px; + margin-left: 10px; + margin-right: 10px; +} +#skill-btn-divider{ + border-left: black 1px solid; + padding-right: 10px; + padding-top: 10px; + padding-bottom: 10px; } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html index 5daac83..c214590 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html @@ -1,19 +1,24 @@
- + {{ability.value}}
- {{ability.modification}} + Mod: {{ability.modification > 0? '+' + ability.modification : '-' + ability.modification}}
{{ability.name}} -
-
- {{ability.savingthrows}} +
+
+ ST: {{ability.savingthrows > 0? '+' + ability.savingthrows : '-' + ability.savingthrows}}
- - - + + + + {{skill.name}} +     + + {{skill.value > 0? '+' + skill.value : '-' + skill.value}} +
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.spec.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.spec.ts deleted file mode 100644 index f8de036..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { AbilityCardComponent } from './ability-card.component'; - -describe('StatisticCardComponent', () => { - let component: AbilityCardComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ AbilityCardComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(AbilityCardComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts index 2f8e4f5..f525ccd 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.ts @@ -8,8 +8,12 @@ import { AbilityViewModel } from '../../../types/viewmodels/ability-viewmodels/A }) export class AbilityCardComponent implements OnInit { @Input() ability: AbilityViewModel; + @Input() headStyle: { bgColor: string; textColor: string }; + @Input() contentStyle: { bgColor: string; textColor: string }; constructor() {} - ngOnInit() {} + ngOnInit() { + this.ability.skills.sort((a, b) => (a.name > b.name ? 1 : -1)); + } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html index a9dd20f..8b13789 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html @@ -1,5 +1 @@ -

-

-

-

- + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts index 2c99938..7f89e9f 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts @@ -1,5 +1,4 @@ -import { Component, OnInit } from '@angular/core'; -import { AbilityViewModel } from '../../../types/viewmodels/ability-viewmodels/AbilityViewModel'; +import { Component } from '@angular/core'; @Component({ selector: 'app-player-dashboard', @@ -9,16 +8,6 @@ import { AbilityViewModel } from '../../../types/viewmodels/ability-viewmodels/A export class PlayerDashboardComponent { isExpanded = false; - test: AbilityViewModel = { - id: 1, - name: 'Dexterity', - value: 20, - modification: 3, - savingthrows: 1, - canSaveThrows: false, - skills: [], - }; - collapse() { this.isExpanded = false; } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/styles.css b/SessionCompanion/SessionCompanion/ClientApp/src/styles.css index 311e04a..cbfb6da 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/styles.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/styles.css @@ -70,7 +70,7 @@ } mat-divider { - border-top-color: #e9cca7 !important; + border-top-color: #e9cca7; } .arrow-select { From fadeaf1c439d2be74c25de5d3219057f60bf1672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sat, 2 Jan 2021 20:00:15 +0100 Subject: [PATCH 25/26] fix --- .../components/player-dashboard/player-dashboard.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts index 7f89e9f..cffbdec 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-player-dashboard', From 9781b5da1f378266cc9f286a21dfc9b4efad9333 Mon Sep 17 00:00:00 2001 From: Natalia Gawron Date: Sat, 2 Jan 2021 20:36:55 +0100 Subject: [PATCH 26/26] SES-124 display component, small changes --- .../ability-card/ability-card.component.html | 2 +- .../player-dashboard.component.css | 7 +++++++ .../player-dashboard.component.html | 4 +++- .../player-dashboard.component.ts | 17 +++++++++++++++++ .../ability-viewmodels/AbilityViewModel.ts | 2 +- 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html index c214590..376fea9 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/ability-card/ability-card.component.html @@ -8,7 +8,7 @@ {{ability.name}}
- ST: {{ability.savingthrows > 0? '+' + ability.savingthrows : '-' + ability.savingthrows}} + ST: {{ability.savingThrows > 0? '+' + ability.savingThrows : '-' + ability.savingThrows}}
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css index cc4b1d7..544e80b 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.css @@ -35,3 +35,10 @@ .mat-list-item.active{ color: #e9cca7; } + +.ability_card_container { + margin: 5%; + display: flex; + justify-content: center; + align-items: center; +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html index 5777963..994aab5 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.html @@ -52,6 +52,8 @@ - Main content + + +
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts index d2cfe87..91157af 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/player-dashboard/player-dashboard.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import {AbilityViewModel} from "../../../types/viewmodels/ability-viewmodels/AbilityViewModel"; @Component({ selector: 'app-player-dashboard', @@ -9,6 +10,22 @@ export class PlayerDashboardComponent { isExpanded = false; selected = false; + ability: AbilityViewModel = { + id: 1, + name: 'Strength', + value: 18, + modification: 2, + canSaveThrows: true, + savingThrows: 1, + skills: [ + { + name: 'Throw', + value: 1, + can: false + } + ] + } + collapse() { this.isExpanded = false; } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/AbilityViewModel.ts b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/AbilityViewModel.ts index 1ca9248..8c4fb29 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/AbilityViewModel.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/ability-viewmodels/AbilityViewModel.ts @@ -5,7 +5,7 @@ export interface AbilityViewModel { name: string; value: number; modification: number; - savingthrows: number; + savingThrows: number; canSaveThrows: boolean; skills: SkillViewModel[]; }