Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ubclaunchpad/ubcsim2 into showcase
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi committed Jul 23, 2020
2 parents baa9522 + 32055ea commit 3b1e61f
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 27 deletions.
Binary file added .static/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# :thought_balloon: UBC Simulator 2
![UBC Simulator 2](./.static/thumbnail.png)

[![Build Status](https://travis-ci.com/ubclaunchpad/ubcsim2.svg?branch=master)](https://travis-ci.com/ubclaunchpad/ubcsim2)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"private": true,
"description": "A 'choose your own adventure' style browser game where the player attempts to survive a year as a student at UBC.",
"homepage": "https://ubclaunchpad.github.io/ubcsim2",
"homepage": "https://ubcsim2.ubclaunchpad.com",
"main": "index.js",
"scripts": {
"lint": "tslint --project tsconfig.json",
Expand Down
1 change: 1 addition & 0 deletions public/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ubcsim2.ubclaunchpad.com
1 change: 1 addition & 0 deletions public/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ p {
text-align: center;
padding: 0;
margin: 0;
flex-direction: column;
}

#game-container {
Expand Down
3 changes: 3 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

<!-- Import Font -->
<link href="https://fonts.googleapis.com/css?family=VT323&display=swap" rel="stylesheet">

<!-- Fathom - website analytics https://app.usefathom.com/share/dymzbwsl/ubcsim2.ubclaunchpad.com -->
<script src="https://chinchilla.ubclaunchpad.com/script.js" site="DYMZBWSL" excluded-domains="localhost" defer></script>
</head>

<body>
Expand Down
7 changes: 6 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const emptyMinigame: IMinigame = {
};

export default class App extends React.Component<IProps, IState> {
static readonly maxWeeks: number = 5;
static readonly maxWeeks: number = 9;
private choiceManager: ChoicesManager;
private eventManager: EventsManager;
private minigameManager: MinigamesManager;
Expand Down Expand Up @@ -223,6 +223,11 @@ export default class App extends React.Component<IProps, IState> {
</div>
</section>
</div>
<div style={{ marginTop: "32px" }}>
<p>
A <a href="https://ubclaunchpad.com" target="_blank" rel="noopener noreferrer">UBC Launch Pad</a> project.
</p>
</div>
</div>
);
}
Expand Down
10 changes: 5 additions & 5 deletions src/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"choices": [
"LoremIpsum"
],
"hasBottomBoxBorder": false,
"hasBottomBoxBorder": true,
"hasInnerFill": true,
"gamePlayMode": "Comics"
},
Expand All @@ -90,7 +90,7 @@
"choices": [
"DarnIt"
],
"hasBottomBoxBorder": false,
"hasBottomBoxBorder": true,
"hasInnerFill": true,
"gamePlayMode": "Comics"
},
Expand All @@ -100,7 +100,7 @@
"choices": [
"BlockPartyCancelled"
],
"hasBottomBoxBorder": false,
"hasBottomBoxBorder": true,
"hasInnerFill": true,
"gamePlayMode": "Comics"
},
Expand Down Expand Up @@ -149,7 +149,7 @@
},
"StormTheWallEvent": {
"prompt": "Wanna Storm the Wall bro?",
"imgPath": "StormTheWallEvent/stormTheWall",
"imgPath": "StormTheWallEvent/stormTheWall.png",
"choices": [
"ScaleWall",
"CantReachTopShelf"
Expand Down Expand Up @@ -220,4 +220,4 @@
"hasInnerFill": true,
"gamePlayMode": "GameOver"
}
}
}
13 changes: 7 additions & 6 deletions src/game-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
"pool": [
"CuteGirlEvent",
"SquirrelEvent",
"MidtermEvent"
"MidtermEvent",
"BlockPartyEvent",
"CoronaEvent"
],
"followUp": [
"LandingEvent", "PickFacultyEvent"
"LandingEvent", "PickFacultyEvent", "ImagineDayEvent"
],
"seasonal": [
["ImagineDayEvent"],
[],
["DayOfTheLongBoatEvent", "BoomerGregorEvent", "FratPartyEvent"],
["StormTheWallEvent", "CryMidtermPaperEvent"],
["BlockPartyEvent", "CoronaEvent"]
["StormTheWallEvent", "CryMidtermPaperEvent"]
]
}
}
}
11 changes: 4 additions & 7 deletions src/minigames.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
{
"EssayWrite":
{
"EssayWrite": {
"build": "essay_write",
"winStatChanges": [0, 1, 0],
"loseStatChanges": [0, -1, 0],
"prompt": "Click to write your essay!"
},
"SquirrelJump":
{
"SquirrelJump": {
"build": "squirrel_jump",
"winStatChanges": [10, 0.5, 0],
"loseStatChanges": [-20, -0.5, 0],
"prompt": "Jump over all the squirrels!"
"prompt": "Click to jump over all the squirrels!"
},
"ToiletPaperCatch":
{
"ToiletPaperCatch": {
"build": "toilet_paper_catch",
"winStatChanges": [10, 0, 10],
"loseStatChanges": [-10, -0, -10],
Expand Down
10 changes: 4 additions & 6 deletions src/trackers/EventTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,17 @@ export default class EventTracker {
if (this.queue.length > 0)
return this.queue.shift() as IEvent;

// const r = Math.random() * 100;
// 0 to 11
const month = (Math.floor(week / 4)) % 4;
if (this.pool.length > 0 &&
(this.seasonal[month].length === 0)) {
const r = Math.random() * 100;
const month = (Math.floor(week / 4)) % 3; // 0 to 11
if (this.pool.length > 0 && (r > this.SEASONAL_CHANCE || this.seasonal[month].length === 0)) {
// If we roll a normal pool or if there are no seasonal events then
// use the normal pool (given that there are still things in the
// normal pool)
let event = this.pool[Math.floor(Math.random() * this.pool.length)];
const index = this.pool.indexOf(event);
this.pool.splice(index, 1);
return event;
} else if (this.seasonal[month].length > 0) {
} else if (r <= this.SEASONAL_CHANCE || this.seasonal[month].length > 0) {
// Else we use the seasonal events pool
let event = this.seasonal[month][Math.floor(Math.random() * this.seasonal[month].length)];
const index = this.seasonal[month].indexOf(event);
Expand Down

0 comments on commit 3b1e61f

Please sign in to comment.