Skip to content

Commit

Permalink
Merge pull request #36 from markxoe/development
Browse files Browse the repository at this point in the history
0.15.0
  • Loading branch information
markxoe authored Apr 29, 2021
2 parents 58b4c4a + f7f1e6b commit 73d2acd
Show file tree
Hide file tree
Showing 15 changed files with 133 additions and 14 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "org.toastbrot.ichbineinebienemobile"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 32
versionName "0.14.1"
versionCode 33
versionName "0.15.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
8 changes: 4 additions & 4 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 26;
CURRENT_PROJECT_VERSION = 27;
DEVELOPMENT_TEAM = 7BZBLBDUSX;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.14.1;
MARKETING_VERSION = 0.15.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = org.toastbrot.ichbineinebienemobile;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -375,12 +375,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 26;
CURRENT_PROJECT_VERSION = 27;
DEVELOPMENT_TEAM = 7BZBLBDUSX;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.14.1;
MARKETING_VERSION = 0.15.0;
PRODUCT_BUNDLE_IDENTIFIER = org.toastbrot.ichbineinebienemobile;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = USE_PUSH;
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ichbineinebiene-mobile",
"version": "0.14.1",
"version": "0.15.0",
"private": true,
"dependencies": {
"@capacitor-community/firebase-analytics": "^0.2.0",
Expand Down
6 changes: 5 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/markxoe/ich-bin-eine-biene-mobile?style=flat-square)
![GitHub package.json dynamic](https://img.shields.io/github/package-json/version/markxoe/ich-bin-eine-biene-mobile?style=flat-square)

## NEU - Discord Server
## ~~NEU -~~ Discord Server

[![Neu: Discord Server](https://img.shields.io/badge/NEU-DISCORD%20SERVER-orange?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/fh3sVAtrB9)

Expand Down Expand Up @@ -37,6 +37,10 @@ Mark Oude Elberink

## Changelog

### [0.15.0] Caves and Cliffs :mountain:

- :sparkles:Drachen:sparkles: :dragon:

### [0.14.1] Chicken Cats :rooster: :cat:

- Discord Link
Expand Down
6 changes: 6 additions & 0 deletions src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import React from "react";
import { render } from "@testing-library/react";
import App from "./App";

import packageJSON from "../package.json";
import releaseNotesJSON from "./other/release-notes.json";

test("renders without crashing", () => {
const { baseElement } = render(<App />);
expect(baseElement).toBeDefined();
});
test("Release Notes Header includes latest Version", () => {
expect(releaseNotesJSON.header).toContain(packageJSON.version);
});
6 changes: 6 additions & 0 deletions src/globals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export const getAutorotatePrice = (state: stateType): number => {
return Math.round(getAdditionalBeePrice(state) * 3);
};

export const getDragonPrice = (state: stateType): number => {
return 100000;
};

export const renderValue = (value: number): string => {
if (value > 1000000) {
return value.toExponential(4);
Expand Down Expand Up @@ -161,6 +165,7 @@ export const uploadData = (state: stateType) => {
settingClickingAid: boolean;
userImage: string;
goldenBienens: number;
dragons: number;
} = {
userid: state.userUUID,
autoRotatingBeeLength: state.biene.autoRotatingBees.length,
Expand All @@ -171,6 +176,7 @@ export const uploadData = (state: stateType) => {
settingNewUI: state.settings.newUI,
userImage: state.userImage,
goldenBienens: state.goldenBienen,
dragons: state.biene.dragons,
};

Axios.post(
Expand Down
4 changes: 2 additions & 2 deletions src/other/release-notes.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"header": "Version 0.14.0",
"message": "0.14.0: Chicken Cats, Neues: Verwarnungen, Freiwillige Preissteigerung"
"header": "Version 0.15.0",
"message": "0.15.0: Caves and Cliffs, Drachen *Juhu*"
}
32 changes: 32 additions & 0 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import packagejs from "../../package.json";
import releaseNotes from "../other/release-notes.json";

import biene from "../res/biene.png";
import dragon from "../res/dragon.png";
import { getGoldenBienenArray } from "../res/advancementBees/getbee";

import { AppContext } from "../store/State";
Expand Down Expand Up @@ -70,6 +71,7 @@ import { KeepAwakePlugin } from "@capacitor-community/keep-awake";
import { v4, validate } from "uuid";
import axios from "axios";
import { APIgetWarning } from "../functions/api";
import Confetti from "react-confetti";
const Firebase = Plugins.FirebaseAnalytics as FirebaseAnalyticsPlugin;
const KeepAwake = Plugins.KeepAwake as KeepAwakePlugin;

Expand All @@ -87,6 +89,8 @@ const Home: React.FC = () => {

const [warning, setWarning] = useState<boolean | string>(false);

const [runningConfetti, setRunningConfetti] = useState<boolean>(false);

useIonViewWillEnter(async () => {
PushNotifications.requestPermission()
.then((result) => {
Expand Down Expand Up @@ -253,6 +257,22 @@ const Home: React.FC = () => {

return (
<IonPage>
<Confetti
recycle={false}
gravity={0.8}
initialVelocityX={{ min: -10, max: 10 }}
initialVelocityY={{ min: -15, max: 0 }}
confettiSource={{
h: 50,
w: 50,
x: window.innerWidth / 2 - 25,
y: window.innerHeight / 2 - 25,
}}
friction={0.999}
numberOfPieces={50}
tweenDuration={500}
run={runningConfetti}
/>
<IonHeader>
<IonToolbar>
<IonButtons collapse slot="start">
Expand Down Expand Up @@ -392,6 +412,15 @@ const Home: React.FC = () => {
</IonCol>
))}
</IonRow>
<IonRow className="ion-justify-content-center">
{Array(state.biene.dragons)
.fill(0)
.map(() => (
<IonCol size="auto" onClick={() => setRunningConfetti(true)}>
<img src={dragon} width="54" alt="Drache" />
</IonCol>
))}
</IonRow>
<IonRow className="ion-justify-content-center">
{/* This part shows the informations */}
<IonCol size="auto" class="ion-text-center">
Expand Down Expand Up @@ -438,6 +467,9 @@ const Home: React.FC = () => {
<IonChip hidden={!state.settings.newUI} color="warning">
Saltos: {renderValue(state.biene.clickCounter)}
</IonChip>
<IonChip hidden={state.biene.dragons <= 0} color="warning">
Drachen: {renderValue(state.biene.dragons)}
</IonChip>
<IonChip
onClick={() => setOpenLevels(true)}
color={calculateLevel(state).levelColor}>
Expand Down
3 changes: 3 additions & 0 deletions src/pages/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const PageLeaderboard: React.FC = () => {
settingClickingAid: boolean;
userImage: string;
goldenBienens: number;
dragons?: number;
};
}[]
>([]);
Expand All @@ -56,6 +57,7 @@ const PageLeaderboard: React.FC = () => {
settingClickingAid: boolean;
userImage: string;
goldenBienens: number;
dragons?: number;
};
} | null>(null);

Expand Down Expand Up @@ -145,6 +147,7 @@ const PageLeaderboard: React.FC = () => {
<p hidden={!i.user.goldenBienens}>
{i.user.goldenBienens} Goldene Biene(n)
</p>
<p hidden={!i.user.dragons}>{i.user.dragons ?? 0} Drachen</p>
</IonLabel>
{i.user.goldenBienens > 0 ? (
<img
Expand Down
54 changes: 54 additions & 0 deletions src/pages/Store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
rotateSpeedLevel,
uploadData,
uploadEvent,
getDragonPrice,
} from "../globals";
import {
ActionBieneAddAdditional,
Expand All @@ -47,6 +48,7 @@ import {
ActionRotateSpeedLevelIncrease,
ActionSetState,
ActionSetMultiplyPrices,
ActionAddDragon,
} from "../store/Actions";
import { RefresherEventDetail } from "@ionic/core";
import { flashOutline } from "ionicons/icons";
Expand All @@ -69,6 +71,8 @@ const StorePage: React.FC = () => {

const autorotatingPrice = getAutorotatePrice(state);

const dragonPrice = getDragonPrice(state);

const [confettiChilds, setConfettiChilds] = useState<JSX.Element[]>([]);

useIonViewDidEnter(() => {
Expand Down Expand Up @@ -429,6 +433,56 @@ const StorePage: React.FC = () => {
</IonGrid>
</IonCardContent>
</IonCard>
<IonCard>
<IonCardHeader>
<IonCardTitle>Drache</IonCardTitle>
<IonCardSubtitle className="ion-text-uppercase">
Macht garnix
</IonCardSubtitle>
</IonCardHeader>
<IonCardContent>
<IonGrid>
<IonRow>
<IonCol>
<IonButton
onClick={() => {
if (state.biene.clickCounter >= dragonPrice) {
dispatch(ActionAddDragon());
dispatch(ActionBieneClickDecrease(dragonPrice));
setShowThx(true);
onBuy();
Firebase.logEvent({
name: "StoreBuyDragon",
params: { price: dragonPrice },
}).catch(() => {});
uploadEvent(state, { type: "BoughtDragon" });
}
}}
disabled={state.biene.clickCounter < dragonPrice}>
Drachen kaufen
</IonButton>
</IonCol>
<IonCol>
<h2>Preis: {renderValue(dragonPrice)}</h2>
<IonProgressBar
color={
state.biene.clickCounter < dragonPrice
? "danger"
: "success"
}
value={Math.min(
state.biene.clickCounter / dragonPrice,
1.0
)}
/>
</IonCol>
</IonRow>
<IonRow>
<IonCol>Deine Drachen: {state.biene.dragons}/∞</IonCol>
</IonRow>
</IonGrid>
</IonCardContent>
</IonCard>
<IonCard>
<IonCardHeader>
<IonCardTitle>Goldene Biene</IonCardTitle>
Expand Down
Binary file added src/res/dragon.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: 2 additions & 0 deletions src/store/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,5 @@ export const ActionSetMultiplyPrices = (activated: boolean): actionType => ({
type: "setMultiplyPrices",
payload: activated,
});

export const ActionAddDragon = (): actionType => ({ type: "addDragon" });
11 changes: 11 additions & 0 deletions src/store/State.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const initialState: stateType = {
additionalBienen: [],
multiplierLevel: 0,
autoRotatingBees: [],
dragons: 0,
},
goldenBienen: 0,
settings: {
Expand Down Expand Up @@ -203,6 +204,7 @@ let reducer = (state: stateType, action: actionType): stateType => {
autoRotatingBees: [],
clickCounter: 0,
rotateSpeedLevel: 0,
dragons: 0,
},
};
}
Expand All @@ -216,6 +218,15 @@ let reducer = (state: stateType, action: actionType): stateType => {
},
};
}
case "addDragon": {
return {
...state,
biene: {
...state.biene,
dragons: state.biene.dragons + 1,
},
};
}
}

return state;
Expand Down
1 change: 1 addition & 0 deletions src/store/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface stateType {
additionalBienen: number[];
multiplierLevel: number;
autoRotatingBees: number[];
dragons: number;
};
goldenBienen: number;
settings: {
Expand Down

0 comments on commit 73d2acd

Please sign in to comment.