This server is intended for use for Academic Classwork related Git repositories only. Projects/repositories will generally be removed after 6 months following close of the semester. Inactive repositories from previous semester are now being archived when no activity for 365 days. They are renamed and marked as 'archived'. After 90 days in that state they will be removed from the system completely.

Commit 2f774744 authored by Pamela Petterchak's avatar Pamela Petterchak

finishing touches pt 1

parent 84ff0391
......@@ -14,6 +14,13 @@
<img src="assets/Reservoir.png" (click)="reservoirUpgrade()" />
</button>
<h4>multiplier: {{ accumulatesMulti | async }}</h4>
<!-- Add more buttons for upgrades here, with their own functions -->
\ No newline at end of file
<h4>pickles per second: {{ accumulatesMulti | async }}</h4>
<h4>number of jars: {{ jarCount | async }}</h4>
<h4>cost per jar: {{ jarCost | async }}</h4>
<h4>number of barrels: {{ barrelCount | async }}</h4>
<h4>cost per barrel: {{ barrelCost | async }}</h4>
<h4>number of silos: {{ siloCount | async }}</h4>
<h4>cost per silo: {{ siloCost | async }}</h4>
<h4>number of reservoirs: {{ reservoirCount | async }}</h4>
<h4>cost per reservoir: {{ reservoirCost | async }}</h4>
<h4>cost to purchase the golden key: 100,000,000</h4>
......@@ -10,6 +10,14 @@ export class AccumulatorsComponent {
readonly totalClicks = this.service.pickleCount;
readonly clickMulti = this.service.incrementsClicksVal;
readonly accumulatesMulti = this.service.accumulatesVal;
readonly jarCount = this.service.jarCount;
readonly barrelCount = this.service.barrelCount;
readonly siloCount = this.service.siloCount;
readonly reservoirCount = this.service.reservoirCount;
readonly jarCost = this.service.jarCost;
readonly barrelCost = this.service.barrelCost;
readonly siloCost = this.service.siloCost;
readonly reservoirCost = this.service.reservoirCost;
constructor(private service: GamePlayService) {}
......
......@@ -10,7 +10,7 @@
<div class="row">
<div class="column">
<mat-card class="title">
<mat-card-title>Resources</mat-card-title>
<mat-card-title>Manufacturers</mat-card-title>
</mat-card>
<app-accumulators></app-accumulators>
</div>
......
......@@ -19,19 +19,27 @@ export class GamePlayService {
private readonly jars = new BehaviorSubject<number>(0);
readonly jarCount = this.jars.asObservable();
jarCost = 5;
private readonly jarsCosts = new BehaviorSubject<number>(5);
readonly jarCost = this.jarsCosts.asObservable();
private readonly barrels = new BehaviorSubject<number>(0);
readonly barrelCount = this.jars.asObservable();
barrelCost = 50;
readonly barrelCount = this.barrels.asObservable();
private readonly barrelsCosts = new BehaviorSubject<number>(50);
readonly barrelCost = this.barrelsCosts.asObservable();
private readonly silos = new BehaviorSubject<number>(0);
readonly siloCount = this.jars.asObservable();
siloCost = 500;
readonly siloCount = this.silos.asObservable();
private readonly silosCosts = new BehaviorSubject<number>(500);
readonly siloCost = this.silosCosts.asObservable();
private readonly reservoirs = new BehaviorSubject<number>(0);
readonly reservoirCount = this.jars.asObservable();
reservoirCost = 5000;
readonly reservoirCount = this.reservoirs.asObservable();
private readonly reservoirsCosts = new BehaviorSubject<number>(5000);
readonly reservoirCost = this.reservoirsCosts.asObservable();
constructor() {
console.log('Game service activated');
......@@ -58,11 +66,13 @@ export class GamePlayService {
async jarUpgrade() {
if (
this.pickles.value >=
this.jarCost + this.jars.value * (this.jars.value + 1) * 5
this.jarsCosts.value + this.jars.value * (this.jars.value + 1) * 5
) {
this.jarCost = this.jarCost + this.jars.value * (this.jars.value + 1) * 5;
this.jarsCosts.next(
this.jarsCosts.value + this.jars.value * (this.jars.value + 1) * 5
);
this.accumulates.next(this.accumulates.value + 5);
this.pickles.next(this.pickles.value - this.jarCost);
this.pickles.next(this.pickles.value - this.jarsCosts.value);
this.jars.next(this.jars.value + 1);
}
// need to add else to throw error
......@@ -71,12 +81,15 @@ export class GamePlayService {
async barrelUpgrade() {
if (
this.pickles.value >=
this.barrelCost + this.barrels.value * (this.barrels.value + 1) * 50
this.barrelsCosts.value +
this.barrels.value * (this.barrels.value + 1) * 50
) {
this.barrelCost =
this.barrelCost + this.barrels.value * (this.barrels.value + 1) * 50;
this.barrelsCosts.next(
this.barrelsCosts.value +
this.barrels.value * (this.barrels.value + 1) * 50
);
this.accumulates.next(this.accumulates.value + 50);
this.pickles.next(this.pickles.value - this.barrelCost);
this.pickles.next(this.pickles.value - this.barrelsCosts.value);
this.barrels.next(this.barrels.value + 1);
}
}
......@@ -84,12 +97,13 @@ export class GamePlayService {
async siloUpgrade() {
if (
this.pickles.value >=
this.siloCost + this.silos.value * (this.silos.value + 1) * 500
this.silosCosts.value + this.silos.value * (this.silos.value + 1) * 500
) {
this.siloCost =
this.siloCost + this.silos.value * (this.silos.value + 1) * 500;
this.silosCosts.next(
this.silosCosts.value + this.silos.value * (this.silos.value + 1) * 500
);
this.accumulates.next(this.accumulates.value + 500);
this.pickles.next(this.pickles.value - this.siloCost);
this.pickles.next(this.pickles.value - this.silosCosts.value);
this.silos.next(this.silos.value + 1);
}
}
......@@ -97,14 +111,15 @@ export class GamePlayService {
async reservoirUpgrade() {
if (
this.pickles.value >=
this.reservoirCost +
this.reservoirs.value * (this.reservoirs.value + 1) * 5000
this.reservoirsCosts.value +
this.reservoirs.value * (this.reservoirs.value + 1) * 5000
) {
this.reservoirCost =
this.reservoirCost +
this.reservoirs.value * (this.reservoirs.value + 1) * 5000;
this.reservoirsCosts.next(
this.reservoirsCosts.value +
this.reservoirs.value * (this.reservoirs.value + 1) * 5000
);
this.accumulates.next(this.accumulates.value + 5000);
this.pickles.next(this.pickles.value - this.reservoirCost);
this.pickles.next(this.pickles.value - this.reservoirsCosts.value);
this.reservoirs.next(this.reservoirs.value + 1);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment