Skip to content

Commit

Permalink
Merge pull request #157 from Daelso/hunter_fix
Browse files Browse the repository at this point in the history
Hunter fix
  • Loading branch information
Daelso authored Apr 7, 2024
2 parents 85b6ef9 + f184a7e commit f4e51d4
Show file tree
Hide file tree
Showing 12 changed files with 572 additions and 13 deletions.
2 changes: 2 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const garouRoutes = require("./server/api/garou");
app.use("/garou", garouRoutes);
const ladRoutes = require("./server/api/showlads");
app.use("/showlads", ladRoutes);
const gameFinderRoutes = require("./server/api/game_finder");
app.use("/game_finder", gameFinderRoutes);
//Uses userRoutes file to handle all user related endpoints

//Below are various controller links
Expand Down
25 changes: 25 additions & 0 deletions server/api/game_finder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const express = require("express");
const cookieParser = require("cookie-parser");
const sequelize = require("../database");
require("dotenv").config();
const app = express();

let router = express.Router();
router.use(cookieParser());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
const GameStyles = require("../models/game_finder/game_styles.js");
const lib = require("../lib");

//Route is base/game_finder/
router.route("/styles").get(lib.getLimiter, async (req, res) => {
try {
const styles = await GameStyles.findAll();

res.status(200).json(styles);
} catch (err) {
res.status(403).send(err);
}
});

module.exports = router; //Exports our routes
21 changes: 21 additions & 0 deletions server/models/game_finder/game_styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const Sequelize = require("sequelize");
const db = require("../../database");

const GameStyles = db.sequelize.define(
"game_styles",
{
style_id: {
type: Sequelize.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
style: {
type: Sequelize.STRING,
allowNull: false,
},
},
{ timestamps: false }
);

module.exports = GameStyles;
14 changes: 7 additions & 7 deletions src/boot/axios.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { boot } from 'quasar/wrappers'
import axios from 'axios'
import { boot } from "quasar/wrappers";
import axios from "axios";

// Be careful when using SSR for cross-request state pollution
// due to creating a Singleton instance here;
// If any client changes this (global) instance, it might be a
// good idea to move this instance creation inside of the
// "export default () => {}" function below (which runs individually
// for each client)
const api = axios.create({ baseURL: 'https://api.example.com' })
const api = axios.create({ baseURL: "https://api.example.com" });

export default boot(({ app }) => {
// for use inside Vue files (Options API) through this.$axios and this.$api

app.config.globalProperties.$axios = axios
app.config.globalProperties.$axios = axios;
// ^ ^ ^ this will allow you to use this.$axios (for Vue Options API form)
// so you won't necessarily have to import axios in each vue file

app.config.globalProperties.$api = api
app.config.globalProperties.$api = api;
// ^ ^ ^ this will allow you to use this.$api (for Vue Options API form)
// so you can easily perform requests against your app's API
})
});

export { api }
export { api };
2 changes: 1 addition & 1 deletion src/components/character_creator/hunter/spendXp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export default defineComponent({
this.cost = "Skill is maxxed!";
this.canBuy = false;
}
this.cost = this.skills[this.skillCategory.toLowerCase()] * 3;
this.cost = (this.skills[this.skillCategory.toLowerCase()] + 1) * 3;
break;
case "Specialty":
this.cost = 3;
Expand Down
5 changes: 5 additions & 0 deletions src/components/character_creator/vtm/5eAttributes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
>Attribute Points Remaining: {{ this.attributePoints }}</q-badge
>
<div
v-if="!this.info.debug"
class="q-ma-sm q-pa-sm"
style="
background-color: #222831;
Expand Down Expand Up @@ -335,6 +336,10 @@ export default defineComponent({
return check;
},
checkIfGood() {
if (this.info.debug) {
this.attributesDone = true;
return false;
}
let attributes = [
this.charisma,
this.composure,
Expand Down
74 changes: 74 additions & 0 deletions src/components/character_creator/vtm/5eMerits.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,28 @@
}
]
},
"Contagion": {
"advantages": [
{
"name": "Blood Empathy",
"cost": 2,
"desc": "You share a closer bond to your domitor than most ghouls, able to sense their emotional and psychological state."
}
],
"flaws": [
{
"name": "Disease Vector",
"cost": 1,
"desc": "Whenever you feed from a sick mortal, you always contract that sickness and will pass it on to your next vessel."
},
{
"name": "Plaugebringer",
"cost": 1,
"maxCost": 2,
"desc": "You have a disease in your vitae, at one dot it is something mild like sores or a rash. At two, it can be debilitating. There is no way to cure this. Mortals you feed from are vulnerable to your diseases."
}
]
},
"Feeding": {
"advantages": [
{
Expand Down Expand Up @@ -278,6 +300,16 @@
"cost": 2,
"desc": "Your body does not automatically revert to the death-state each night allowing you to keep haircuts, tattoos or things like piercings in. Only available while potency is 1 or lower."
},
{
"name": "Pack Diablerie",
"cost": 2,
"desc": "If you attempt a pack diablerie, you are always the one who has the chance to consume the whole soul. If you help another consume a soul, you gain 5 xp."
},
{
"name": "Cold Dead Hunger",
"cost": 3,
"desc": "You've gained mastery over your hunger. Add two die to your rolls to resist hunger frenzy."
},
{
"name": "Luck of the Devil",
"cost": 4,
Expand Down Expand Up @@ -374,9 +406,51 @@
"name": "False Love",
"cost": 1,
"desc": "Choose an NPC as your obsession, when in that NPC's presence, treat your humanity as 1 point above what it is. DOES NOT COMBINE WITH OTHERS. If the character dies, gain 3 stains and choose a new obsession."
},
{
"name": "Penitence",
"cost": 1,
"maxCost": 5,
"desc": "For each dot you possess in this Merit, you can scourge yourself once per session as part of a scene, suffering one point of Superficial Health damage and immediately healing one point of Superficial Willpower damage"
},
{
"name": "Unholy Will (2)",
"cost": 2,
"desc": "At two dots, add one die to any dice pool when you resist or contest an individual with true Faith on matters of their faith"
},
{
"name": "Unholy Will (4)",
"cost": 4,
"desc": "At four dots, add two die to any dice pool when you resist or contest an individual with true Faith on matters of their faith"
},
{
"name": "Zealotry",
"cost": 1,
"maxCost": 3,
"desc": "For each dot in this Merit, once per session after rolling a normal success on an action that corresponds to or aligns with one of your Convictions, you may choose to turn that normal success into a messy critical instead."
}
],
"flaws": [
{
"name": "Beacon of Profanity",
"cost": 1,
"desc": "Mortals with any amount of True Faith can sense your presence"
},
{
"name": "Crisis of Faith",
"cost": 1,
"desc": "Bestial failures also cause 1 point of superficial WP damage."
},
{
"name": "Groveling Worm",
"cost": 2,
"desc": "You must find time to scourge your flesh at least once per session."
},
{
"name": "Horrible Scars of Penitence",
"cost": 1,
"desc": "Your scars give you away as a crazed zealot."
},
{
"name": "Living on the Edge",
"cost": 2,
Expand Down
77 changes: 72 additions & 5 deletions src/components/character_creator/vtm/vampire-5e.vue
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,51 @@
</q-expansion-item>
</q-list>
</div>
<!-- <q-btn
flat
:label="!this.debug ? 'Make Homebrew/SPC' : 'Disable Homebrew'"
type="submit"
color="white"
@click="this.homebrewDialog = true"
/> -->

<q-dialog v-model="homebrewDialog" persistent>
<q-card style="background-color: #222831">
<q-card-section class="row items-center">
<q-avatar />
<span class="q-ml-sm" style="color: white"
>This will disable any rules and allow you to make this
character any way you would like. This character will be marked
as homebrew/SPC. It is highly recommended you get permission
from your ST if you want to use this character in a game.
Resetting this option will clear the character.
<br />
<br />
Be aware you are liable to overrun the PDF if you take a ton of
disciplines, specialties, etc
</span>
</q-card-section>

<q-card-actions align="right">
<q-btn flat label="Cancel" color="white" v-close-popup />
<q-btn
v-if="this.debug === false"
flat
label="Make Homebrew"
color="white"
@click="this.homebrewHelper()"
/>
<q-btn
v-else
flat
@click="this.homebrewHelper()"
label="Disable Homebrew"
color="white"
v-close-popup
/>
</q-card-actions>
</q-card>
</q-dialog>

<template v-slot:action>
<q-btn
Expand Down Expand Up @@ -360,14 +405,12 @@
</q-item-section>
</q-item>
<q-item
:disable="
(!this.skillsDone || !this.attributesDone) && this.debug !== true
"
:disable="(!this.skillsDone || !this.attributesDone) && !this.debug"
clickable
@click="clanSelected"
>
<q-tooltip
v-if="!this.skillsDone || !this.attributesDone"
v-if="!this.skillsDone || (!this.attributesDone && !this.debug)"
class="bg-dark text-body2"
>Please set valid base attributes and skills.</q-tooltip
>
Expand Down Expand Up @@ -561,8 +604,9 @@ export default {
},
data() {
return {
debug: false,
debug: true,
saving: false,
homebrewDialog: false,
advantagesObj: {
merits: { advantages: [], flaws: [] },
backgrounds: { advantages: [], flaws: [] },
Expand Down Expand Up @@ -712,6 +756,23 @@ export default {
};
},
methods: {
homebrewHelper() {
this.debug = !this.debug;
if (this.debug) {
this.xp = 999;
this.totalSpecialty = 999;
this.advantages = 999;
this.flaws = 999;
this.attributePoints = 45;
this.skillPoints = 135;
} else {
window.location.reload();
}
this.homebrewDialog = false;
},
onSubmit() {
if (this.saving === true) {
this.$q.notify({
Expand Down Expand Up @@ -777,6 +838,7 @@ export default {
advantages: this.advantagesObj,
advantages_remaining: this.advantages,
flaws_remaining: this.flaws,
homebrew: this.debug,
};
axios
Expand Down Expand Up @@ -831,6 +893,7 @@ export default {
disciplinesDone: this.disciplinesDone,
merits: this.advantagesObj,
altBane: this.altBane,
debug: this.debug,
},
},
})
Expand Down Expand Up @@ -876,6 +939,7 @@ export default {
strength: this.baseStrength,
wits: this.baseWits,
xp: this.xp,
debug: this.debug,
},
},
})
Expand Down Expand Up @@ -908,6 +972,7 @@ export default {
skillDistribution: this.skillDistribution,
skillsDone: this.skillsDone,
specialties: this.specialties,
debug: this.debug,
},
},
})
Expand Down Expand Up @@ -986,6 +1051,8 @@ export default {
},
saveGuard() {
if (this.debug) return false;
//primary sections
if (!this.skillsDone || !this.attributesDone || !this.disciplinesDone) {
this.disableBlurb =
Expand Down
Loading

0 comments on commit f4e51d4

Please sign in to comment.