Skip to content

Commit

Permalink
Merge pull request #79 from jonathan-robertson/add-loot
Browse files Browse the repository at this point in the history
Buy Hot Box, Improve Journal Tips, Add New Edition: Researcher Rewards
  • Loading branch information
jonathan-robertson authored Nov 11, 2022
2 parents 2690ec9 + 8ef1f8b commit ef038d3
Show file tree
Hide file tree
Showing 18 changed files with 367 additions and 23 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: go run .
- name: 📦 Package data
run: |
# Edit this line if you want to include additonal files
# Edit this line if you want to include additional files
# q stands for quiet, r stands for recursive (to include all files and subfolders in Config)
mkdir Config
cp -r Config-Shared/* Config
Expand All @@ -37,6 +37,10 @@ jobs:
cp -r Config-Shared/* Config
cp -r Config-Researcher/* Config
zip -qr "${{ github.event.repository.name }}-researcher.zip" Config ModInfo.xml README.md LICENSE CHANGELOG.md
rm -rf Config/*
cp -r Config-Shared/* Config
cp -r Config-Researcher-Rewards/* Config
zip -qr "${{ github.event.repository.name }}-researcher-rewards.zip" Config ModInfo.xml README.md LICENSE CHANGELOG.md
version=$(sed -n '/Version/{s/.*<Version value=\"\(.*\)\"[ ]*\/>.*/\1/;p}' ModInfo.xml)
echo "version=$version" >> $GITHUB_ENV
Expand All @@ -55,7 +59,7 @@ jobs:
name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
generateReleaseNotes: true
artifacts: "${{ github.event.repository.name }}-standard.zip, ${{ github.event.repository.name }}-researcher.zip"
artifacts: "${{ github.event.repository.name }}-standard.zip, ${{ github.event.repository.name }}-researcher.zip, ${{ github.event.repository.name }}-researcher-rewards.zip"
prerelease: ${{ env.prerelease }}
# if you'd like to review the generated release before publishing it, enable draft mode
# draft: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Config
Config-Standard
Config-Researcher
Config-Researcher-Rewards


# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,go
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.0] - 2022-11-11

- add hotbox to traders' regular inventory
- add new researcher-rewards edition
- add researcher schematics to quest loot
- update hot box description and gmo tooltip

## [2.0.0] - 2022-09-17

- add journal entry explaining gmo farming
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This modlet is truly massive due to all the plant traits and supported combinations of them.

Becuase of this, we relied on Go to generate the necessary xpath files to make this modlet work as envisioned.
Because of this, we relied on Go to generate the necessary xpath files to make this modlet work as envisioned.

## Code Structure

Expand Down
5 changes: 5 additions & 0 deletions Config-Shared/traders.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<config>
<append xpath="/traders/trader_item_groups/trader_item_group[@name='traderAlways']">
<item name="hotbox" count="1" />
</append>
</config>
2 changes: 1 addition & 1 deletion ModInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Name value="GMO Farming" />
<Description value="Genetically modify seeds to grow plants with new properties" />
<Author value="Jonathan Robertson (Kanaverum) and Shavick" />
<Version value="2.0.0" />
<Version value="2.1.0" />
<Website value="https://github.com/jonathan-robertson/gmo-farming" />
</ModInfo>
</xml>
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [2 Editions to Choose From](#2-editions-to-choose-from)
- [`Standard` Experience](#standard-experience)
- [`Researcher` Experience](#researcher-experience)
- [`Researcher Loot` Experience](#researcher-loot-experience)
- [Compatibility](#compatibility)
- [Recognition](#recognition)

Expand Down Expand Up @@ -91,6 +92,18 @@ This Edition is more focused on player specialization and giving the player a ne
- such research is time and resource intensive, requiring intentional effort in working towards the player's desired seeds and traits. Naturally, this will be a challenge and require a significant amount of farming.
- primary focus of this Edition is to provide a difficulty barrier to crafting these new seeds. While the recipes to craft the seeds aren't complicated or challenging, researching them is and this requires players to invest the time if they want the benefit from these enhanced crops. This Edition is an effort to prevent the GMO Farming mod from totally throwing the game out of whack with easy-to-craft super-crops

### `Researcher Loot` Experience

This Edition is the same as Researcher with one major change: players will be able to find schematics in quest loot.

Tier | Enhanced Chance | Single Trait Chance | Double Trait Chance
:---: | :---: | :---: | :---:
1 | 0% | 0% | 0%
2 | 1% | 0% | 0%
3 | 5% | 1% | 0%
4 | 15% | 5% | 1%
5 | 25% | 15% | 5%

## Compatibility

This modlet is compatible with Servers and Clients in all combinations; examine the chart below for details specific to your situation:
Expand Down
6 changes: 6 additions & 0 deletions build-researcher-rewards-locally.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
rm -rf Config
mkdir Config
go run .
cp -r Config-Shared/* Config
cp -r Config-Researcher-Rewards/* Config
15 changes: 10 additions & 5 deletions gen/blocks-researcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ import (
)

// ResearcherBlocks is responsible for producing content for blocks.xml
type ResearcherBlocks struct{}
type ResearcherBlocks struct {
Path string
}

// GetPath returns file path for this producer
func (*ResearcherBlocks) GetPath() string {
func (r *ResearcherBlocks) GetPath() string {
if r.Path != "" {
return r.Path
}
return "Config-Researcher"
}

Expand Down Expand Up @@ -95,14 +100,14 @@ func (*ResearcherBlocks) produceWorkstationHotBox(c chan string) {
</property>
<!-- purchase price -->
<property name="EconomicValue" value="2000"/>
<property name="EconomicValue" value="750"/>
<!-- TODO: Heat -->
<!-- heat -->
<property name="HeatMapStrength" value="2"/>
<property name="HeatMapTime" value="5000"/>
<property name="HeatMapFrequency" value="1000"/>
<!-- TODO: Other -->
<!-- other -->
<property name="TakeDelay" value="5"/>
<property name="WorkstationIcon" value="ui_game_symbol_crops"/>
</block>`
Expand Down
6 changes: 3 additions & 3 deletions gen/blocks-standard.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ func (*StandardBlocks) produceWorkstationHotBox(c chan string) {
</property>
<!-- purchase price -->
<property name="EconomicValue" value="2000"/>
<property name="EconomicValue" value="750"/>
<!-- TODO: Heat -->
<!-- heat -->
<property name="HeatMapStrength" value="2"/>
<property name="HeatMapTime" value="5000"/>
<property name="HeatMapFrequency" value="1000"/>
<!-- TODO: Other -->
<!-- other -->
<property name="TakeDelay" value="5"/>
<property name="WorkstationIcon" value="ui_game_symbol_crops"/>
</block>`
Expand Down
9 changes: 7 additions & 2 deletions gen/items-researcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ import (
)

// ResearcherItems is responsible for producing content for items.xml
type ResearcherItems struct{}
type ResearcherItems struct {
Path string
}

// GetPath returns file path for this producer
func (p *ResearcherItems) GetPath() string {
func (r *ResearcherItems) GetPath() string {
if r.Path != "" {
return r.Path
}
return "Config-Researcher"
}

Expand Down
163 changes: 163 additions & 0 deletions gen/localization-researcher-rewards.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
package gen

import (
"data"
"fmt"
)

// ResearcherLocalization is responsible for producing content for Localization.txt
type ResearcherRewardsLocalization struct {
Path string
}

// GetPath returns file path for this producer
func (r *ResearcherRewardsLocalization) GetPath() string {
if r.Path != "" {
return r.Path
}
return "Config-Researcher-Rewards"
}

// GetFilename returns filename for this producer
func (*ResearcherRewardsLocalization) GetFilename() string {
return "Localization.txt"
}

// Produce xml data to the provided channel
func (p *ResearcherRewardsLocalization) Produce(c chan string) {
defer close(c)
c <- "Key,File,Type,english"
p.produceJournalTipsLocalization(c)
p.produceHotBoxLocalization(c)
p.produceThornyBuffLocalization(c)
for _, plant := range data.Plants {
p.produceSchematicLocalization(c, plant)
p.producePlantLocalization(c, plant)
for _, trait1 := range data.Traits {
if plant.IsCompatibleWith(trait1) {
p.produceSchematicLocalization(c, plant, trait1)
p.producePlantLocalization(c, plant, trait1)
for _, trait2 := range data.Traits {
if trait1.IsCompatibleWith(trait2) && plant.IsCompatibleWith(trait2) {
p.produceSchematicLocalization(c, plant, trait1, trait2)
p.producePlantLocalization(c, plant, trait1, trait2)
}
}
}
}
}
}

func (*ResearcherRewardsLocalization) produceJournalTipsLocalization(c chan string) {
c <- `gmoJournalTip_title,Journal Tip,,"GMO Farming [ff8000][MOD]"`
c <- `gmoJournalTip,Journal Tip,,"Strange recipes for modified seeds can supposedly be found in some of the [ff8000]largest, most dangerous structures[-] around town.... but if that sounds too threatening, craft the [ff8000]Hot Box[-] to research these recipes while out of harm's way.\n\nUsing this new workstation will also allow you to apply these recipes to your seeds - improving them with a variety of special traits!\n\n[00ff80]Bonus[-]: further doubles crop yield (4x yield over unmodified crops)\n\n[00ff80]Explosive[-]: [ff007f]triggers a concealed explosive when stepped on, struck with a melee weapon, or hit with an arrow[-]. Due to the flexible nature of plants, the detonator will not trigger if struck with bullets or other explosives.\n\n[00ff80]Fast[-]: plant reaches maturity in half the time.\n\n[00ff80]Renewable[-]: clean, fresh water allows this plant to spread out its roots and produce crops endlessly.\n\n[00ff80]Thorny[-]: integrates with sharp, metal thorns. [ff007f]Touching them will cause one to bleed[-].\n\n[00ff80]Underground[-]: fused with mushroom dna, allowing growth without the need for sunlight."`
}

func (*ResearcherRewardsLocalization) produceHotBoxLocalization(c chan string) {
c <- `hotbox,blocks,Workstation,Hot Box`
c <- `hotboxDesc,blocks,Workstation,"The Hot Box is a simple workstation that allows enhanced seeds to absorb various materials and take on new traits."`
c <- `hotboxTip,Journal Tip,,"The Hot Box is a simple workstation that allows enhanced seeds to absorb various materials and take on new traits.\n\nLearning how to enhance these seeds will require extensive research and materials... but the payoff is worth it."`
c <- `hotboxTip_title,Journal Tip,,Hot Box`

c <- `lblCategoryTier1SeedResearch,UI,Tooltip,Seed Enhancement Research`
c <- `lblCategoryTier1Seeds,UI,Tooltip,Seed Enhancement`
c <- `lblCategoryTier2SeedResearch,UI,Tooltip,First Trait Research`
c <- `lblCategoryTier2Seeds,UI,Tooltip,First Trait`
c <- `lblCategoryTier3SeedResearch,UI,Tooltip,Second Trait Research`
c <- `lblCategoryTier3Seeds,UI,Tooltip,Second Trait`

}

func (*ResearcherRewardsLocalization) produceThornyBuffLocalization(c chan string) {
c <- `buffInjuryThornsName,buffs,Buff,Thorns`
c <- `buffInjuryCriticalThornsName,buffs,Buff,Critical Thorns`
c <- `buffInjuryThornsDesc,buffs,Buff,"Your skin is pierced by the thorny barbs of an aggressively engineered plant.\n\nStep away from the plant to avoid further injury."`
c <- `buffInjuryThornsTooltip,buffs,Buff,The thorns on this plant are cutting into your skin.`
}

func (*ResearcherRewardsLocalization) producePlantLocalization(c chan string, plant data.Plant, traits ...data.Trait) {
switch len(traits) {
case 0:
c <- fmt.Sprintf(`planted%s1_,blocks,Farming,"%s (Seed, Enhanced)"`,
plant.GetName(), plant.GetDisplayName())
c <- fmt.Sprintf(`planted%s2_,blocks,Farming,"%s (Growing, Enhanced)"`,
plant.GetName(), plant.GetDisplayName())
c <- fmt.Sprintf(`planted%s3_,blocks,Farming,"%s (Enhanced)"`,
plant.GetName(), plant.GetDisplayName())
c <- fmt.Sprintf(`planted%s1_Desc,blocks,Farming,"%s%s%s\n\n%s"`,
plant.GetName(),
plant.GetDescription(),
getEnhancedSeedEffectDescription(),
getSeedReturnDescription(traits),
getInitialEnhancementCraftingTip())
case 1:
c <- fmt.Sprintf(`planted%s1_%c,blocks,Farming,"%s (Seed, %s)"`,
plant.GetName(), traits[0].Code, plant.GetDisplayName(), traits[0].Name)
c <- fmt.Sprintf(`planted%s2_%c,blocks,Farming,"%s (Growing, %s)"`,
plant.GetName(), traits[0].Code, plant.GetDisplayName(), traits[0].Name)
c <- fmt.Sprintf(`planted%s3_%c,blocks,Farming,"%s (%s)"`,
plant.GetName(), traits[0].Code, plant.GetDisplayName(), traits[0].Name)
c <- fmt.Sprintf(`planted%s1_%cDesc,blocks,Farming,"%s%s%s\n\n%s\n\n%s"`,
plant.GetName(),
traits[0].Code,
plant.GetDescription(),
getEnhancedSeedEffectDescription(),
getSeedReturnDescription(traits),
traits[0].GetTraitDescription(),
getHotBoxRequirementTip())
case 2:
if traits[0].Code == traits[1].Code {
c <- fmt.Sprintf(`planted%s1_%c%c,blocks,Farming,"%s (Seed, %s)"`,
plant.GetName(), traits[0].Code, traits[1].Code, plant.GetDisplayName(), traits[0].DoubleName)
c <- fmt.Sprintf(`planted%s2_%c%c,blocks,Farming,"%s (Growing, %s)"`,
plant.GetName(), traits[0].Code, traits[1].Code, plant.GetDisplayName(), traits[0].DoubleName)
c <- fmt.Sprintf(`planted%s3_%c%c,blocks,Farming,"%s (%s)"`,
plant.GetName(), traits[0].Code, traits[1].Code, plant.GetDisplayName(), traits[0].DoubleName)
c <- fmt.Sprintf(`planted%s1_%c%cDesc,blocks,Farming,"%s%s%s\n\n%s\n\n%s"`,
plant.GetName(),
traits[0].Code,
traits[1].Code,
plant.GetDescription(),
getEnhancedSeedEffectDescription(),
getSeedReturnDescription(traits),
traits[0].GetDoubleTraitDescription(),
getHotBoxRequirementTip())
} else {
c <- fmt.Sprintf(`planted%s1_%c%c,blocks,Farming,"%s (Seed, %s, %s)"`,
plant.GetName(), traits[0].Code, traits[1].Code, plant.GetDisplayName(), traits[0].Name, traits[1].Name)
c <- fmt.Sprintf(`planted%s2_%c%c,blocks,Farming,"%s (Growing, %s, %s)"`,
plant.GetName(), traits[0].Code, traits[1].Code, plant.GetDisplayName(), traits[0].Name, traits[1].Name)
c <- fmt.Sprintf(`planted%s3_%c%c,blocks,Farming,"%s (%s, %s)"`,
plant.GetName(), traits[0].Code, traits[1].Code, plant.GetDisplayName(), traits[0].Name, traits[1].Name)
c <- fmt.Sprintf(`planted%s1_%c%cDesc,blocks,Farming,"%s%s%s\n\n%s\n\n%s\n\n%s"`,
plant.GetName(),
traits[0].Code,
traits[1].Code,
plant.GetDescription(),
getEnhancedSeedEffectDescription(),
getSeedReturnDescription(traits),
traits[0].GetTraitDescription(),
traits[1].GetTraitDescription(),
getHotBoxRequirementTip())
}
}
}

func (*ResearcherRewardsLocalization) produceSchematicLocalization(c chan string, plant data.Plant, traits ...data.Trait) {
switch len(traits) {
case 0:
c <- fmt.Sprintf(`%s,blocks,Farming,"%s (Seed, Enhanced) Recipe"`,
plant.GetSchematicName(""), plant.GetDisplayName())
case 1:
c <- fmt.Sprintf(`%s,blocks,Farming,"%s (Seed, %s) Recipe"`,
plant.GetSchematicName(string(traits[0].Code)), plant.GetDisplayName(), traits[0].Name)
case 2:
if traits[0].Code == traits[1].Code {
c <- fmt.Sprintf(`%s,blocks,Farming,"%s (Seed, %s) Recipe"`,
plant.GetSchematicName(string(traits[0].Code)+string(traits[1].Code)), plant.GetDisplayName(), traits[0].DoubleName)
} else {
c <- fmt.Sprintf(`%s,blocks,Farming,"%s (Seed, %s, %s) Recipe"`,
plant.GetSchematicName(string(traits[0].Code)+string(traits[1].Code)), plant.GetDisplayName(), traits[0].Name, traits[1].Name)
}
}
}
13 changes: 9 additions & 4 deletions gen/localization-researcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ import (
)

// ResearcherLocalization is responsible for producing content for Localization.txt
type ResearcherLocalization struct{}
type ResearcherLocalization struct {
Path string
}

// GetPath returns file path for this producer
func (*ResearcherLocalization) GetPath() string {
func (r *ResearcherLocalization) GetPath() string {
if r.Path != "" {
return r.Path
}
return "Config-Researcher"
}

Expand Down Expand Up @@ -45,13 +50,13 @@ func (p *ResearcherLocalization) Produce(c chan string) {

func (*ResearcherLocalization) produceJournalTipsLocalization(c chan string) {
c <- `gmoJournalTip_title,Journal Tip,,"GMO Farming [ff8000][MOD]"`
c <- `gmoJournalTip,Journal Tip,,"Craft the [ff8000]Hot Box[ffffff] to modify seeds with a variety of special traits: [007fff]many of which can be combined[ffffff] and [007fff]a few can even be doubled-up to maximize their effects[ffffff]!\n\n[00ff80]Bonus[ffffff]: further doubles crop yield (4x yield over unmodified crops)\n\n[00ff80]Explosive[ffffff]: [ff007f]triggers a concealed explosive when stepped on, struck with a melee weapon, or hit with an arrow[ffffff]. Due to the flexible nature of plants, the detonator will not trigger if struck with bullets or other explosives.\n\n[00ff80]Fast[ffffff]: plant reaches maturity in half the time.\n\n[00ff80]Renewable[ffffff]: clean, fresh water allows this plant to spread out its roots and produce crops endlessly.\n\n[00ff80]Thorny[ffffff]: integrates with sharp, metal thorns. [ff007f]Touching them will cause one to bleed[ffffff].\n\n[00ff80]Underground[ffffff]: fused with mushroom dna, allowing growth without the need for sunlight."`
c <- `gmoJournalTip,Journal Tip,,"Craft the [ff8000]Hot Box[-] to research and improve your seeds with a variety of special traits!\n\n[00ff80]Bonus[-]: further doubles crop yield (4x yield over unmodified crops)\n\n[00ff80]Explosive[-]: [ff007f]triggers a concealed explosive when stepped on, struck with a melee weapon, or hit with an arrow[-]. Due to the flexible nature of plants, the detonator will not trigger if struck with bullets or other explosives.\n\n[00ff80]Fast[-]: plant reaches maturity in half the time.\n\n[00ff80]Renewable[-]: clean, fresh water allows this plant to spread out its roots and produce crops endlessly.\n\n[00ff80]Thorny[-]: integrates with sharp, metal thorns. [ff007f]Touching them will cause one to bleed[-].\n\n[00ff80]Underground[-]: fused with mushroom dna, allowing growth without the need for sunlight."`
}

func (*ResearcherLocalization) produceHotBoxLocalization(c chan string) {
c <- `hotbox,blocks,Workstation,Hot Box`
c <- `hotboxDesc,blocks,Workstation,"The Hot Box is a simple workstation that allows enhanced seeds to absorb various materials and take on new traits."`
c <- `hotboxTip,Journal Tip,,"The Hot Box is a simple workstation that allows enhanced seeds to absorb various materials and take on new traits."`
c <- `hotboxTip,Journal Tip,,"The Hot Box is a simple workstation that allows enhanced seeds to absorb various materials and take on new traits.\n\nLearning how to enhance these seeds will require extensive research and materials... but the payoff is worth it."`
c <- `hotboxTip_title,Journal Tip,,Hot Box`

c <- `lblCategoryTier1SeedResearch,UI,Tooltip,Seed Enhancement Research`
Expand Down
Loading

0 comments on commit ef038d3

Please sign in to comment.