Did some more work on Perks

This commit is contained in:
Daniel Xie 2017-05-12 16:30:36 -05:00
parent 957b7032b1
commit b2e952b09c

@ -2,7 +2,7 @@
* Defines Perks that are unlocked when you gain enough reputation in a * Defines Perks that are unlocked when you gain enough reputation in a
* company or faction * company or faction
*/ */
Perks = { PerkNames = {
FreeCoffeeCompanyPerk: "Free Coffee", FreeCoffeeCompanyPerk: "Free Coffee",
FreeFoodCompanyPerk: "Free Food", FreeFoodCompanyPerk: "Free Food",
NetworkingCompanyPerk: "Networking", NetworkingCompanyPerk: "Networking",
@ -17,6 +17,27 @@ Perks = {
InsiderKnowledgeFactionPerk: "Insider Knowledge", InsiderKnowledgeFactionPerk: "Insider Knowledge",
} }
PerkInfo = {
FreeCoffee: "Your company provides free coffee, improving your focus " +
"and productivity",
FreeFood: "Your company provides free healthy and nutritious food",
NetworkingCompany: "Working at this company provides many opportunities to " +
"build your professional network!",
PersonalTrainer: "Your company provides a free personal trainer to help you train",
KnowledgeBase: "The company has a comprehensive knowledge base that " +
"you can use to learn",
Nootropics: "Your company provides free nootropics, cognitive-enhancing drugs",
NetworkingFaction: "Being a member of this faction provides many opportunities to " +
"build your network of contacts",
SupercomputerFaction: "You are able to use your Faction's private supercomputer, " +
"giving you unparalleled computing power",
VPN: "You are able to use your Faction's high-speed VPN to more securely " +
"access the Internet",
PrivateServer: "You are able to use your Faction's private server",
InsiderKnowledge: "Other members of the faction give you insider information about other " +
"companies and factions"
}
function Perk(name, reqRep, info) { function Perk(name, reqRep, info) {
this.name = name; this.name = name;
this.info = info; this.info = info;
@ -67,6 +88,8 @@ Perk.fromJSON = function(value) {
Reviver.constructors.Perk = Perk; Reviver.constructors.Perk = Perk;
var freeCoffee = new Perk(PerkNames.FreeCoffeeCompanyPerk, 6000, PerkInfo.FreeCoffee);
/* Company Perks */ /* Company Perks */
//Free Coffee - Increased money and hacking exp gain //Free Coffee - Increased money and hacking exp gain
//Free Food - Increased combat stat gain //Free Food - Increased combat stat gain
@ -83,29 +106,43 @@ Reviver.constructors.Perk = Perk;
//Insider Knowledge - Ppl in faction from other companies have insider information that lets you hack //Insider Knowledge - Ppl in faction from other companies have insider information that lets you hack
// other servers easier. Increase in hack chance // other servers easier. Increase in hack chance
applyPerk = function(perk) { applyPerk = function(perk) {
switch (perk.name) { switch (perk.name) {
case Perks.FreeCoffeeCompanyPerk: case PerkNames.FreeCoffeeCompanyPerk:
//Increase money and hacking exp gain
Player.hacking_money_mult += 1.1;
Player.hacking_exp_mult += 1.1;
break; break;
case Perks.FreeFoodCompanyPerk: case PerkNames.FreeFoodCompanyPerk:
Player.strength_exp_mult += 1.05;
Player.defense_exp_mult += 1.05;
Player.dexterity_exp_mult += 1.05;
Player.agility_exp_mult += 1.05;
break; break;
case Perks.NetworkingCompanyPerk: case PerkNames.NetworkingCompanyPerk:
Player.company_rep_mult += 1.1;
Player.charisma_exp_mult += 1.2;
break; break;
case Perks.PersonalTrainerCompanyPerk: case PerkNames.PersonalTrainerCompanyPerk:
Player.strength_exp_mult += 1.15;
Player.defense_exp_mult += 1.15;
Player.dexterity_exp_mult += 1.15;
Player.agility_exp_mult += 1.15;
break; break;
case Perks.KnowledgeBaseCompanyPerk: case PerkNames.KnowledgeBaseCompanyPerk:
break; break;
case Perks.NootropicsCompanyPerk: case PerkNames.NootropicsCompanyPerk:
break; break;
case Perks.NetworkingFactionPerk: case PerkNames.NetworkingFactionPerk:
break; break;
case Perks.SupercomputerFactionPerk: case PerkNames.SupercomputerFactionPerk:
break; break;
case Perks.VPNFactionPerk: case PerkNames.VPNFactionPerk:
break; break;
case Perks.PrivateServerFactionPerk: case PerkNames.PrivateServerFactionPerk:
break; break;
case Perks.InsiderKnowledgeFactionPerk: case PerkNames.InsiderKnowledgeFactionPerk:
break; break;
default: default:
console.log("WARNING: Unrecognized perk: " + perk.name); console.log("WARNING: Unrecognized perk: " + perk.name);