-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 43be443
Showing
32 changed files
with
740 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* linguist-detectable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Update Github repository information | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Update Github repo info | ||
uses: Darkborderman/github-actions/github-repo-info@master | ||
env: | ||
YML_PATH: metadata.yml | ||
GH_TOKEN: ${{ secrets.PAT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.gradle/ | ||
build/ | ||
|
||
# artifacts | ||
jars/ | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"java.project.sourcePaths": ["src"], | ||
"java.project.referencedLibraries": [ | ||
"lib/*.jar" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Darkborderman | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Starsector-CreateStableLocations | ||
|
||
Configure and create more stable locations in Starsector. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
apply plugin: 'java' | ||
|
||
// project level config | ||
sourceSets.main.java.srcDir 'src' | ||
sourceCompatibility = 1.7 | ||
targetCompatibility = 1.7 | ||
archivesBaseName = 'addstablelocations' | ||
|
||
build { | ||
doLast { | ||
copy { | ||
from jar | ||
into 'jars' | ||
} | ||
} | ||
} | ||
|
||
task release(type: Zip) { | ||
description 'Create releaseable zip file.' | ||
def cmdOutput = 'jq -rj .version mod_info.json'.execute().text | ||
from '.' | ||
include 'src/' | ||
include 'data/' | ||
include 'graphics/' | ||
include 'sounds/' | ||
include 'jars/' | ||
include 'mod_info.json' | ||
archiveName archivesBaseName + '-' + cmdOutput + '.zip' | ||
destinationDir(file('bin/')) | ||
} | ||
|
||
clean { | ||
description 'Cleanup files' | ||
delete fileTree('jars/') { include '*.jar' } | ||
delete fileTree('bin/') { include '*.zip' } | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: './lib/', include: '*.jar') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"CreateStableLocations": { | ||
"AllowStar": true, | ||
"AllowBlackHole": true, | ||
"MaxStableLocationCount": 3, | ||
"RequireStoryPoint": false, | ||
"RequireStoryPointAmount": 1, | ||
"RequiredResources": { | ||
"alpha_core": 1, | ||
"heavy_machinery": 200 | ||
}, | ||
"ConsumedResources": { | ||
"fuel": 500 | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
github: | ||
description: Configure and create more stable locations in Starsector. | ||
enable_discussions: false | ||
enable_issues: false | ||
enable_projects: false | ||
enable_wiki: false | ||
homepage: https://github.com/DarkbordermanModding/Starsector-AddStableLocations | ||
template: false | ||
topics: | ||
- mod | ||
- starsector | ||
- starsector-mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "darkborderman.addstablelocations", | ||
"name": "Add Stable Locations", | ||
"author": "Darkborderman", | ||
"version": "0.0.0", | ||
"description": "Make most character's skills configurable in Starsector.", | ||
"gameVersion": "0.96a-RC10", | ||
"jars": ["jars/addstablelocations.jar"], | ||
"modPlugin": "mod.addstablelocations.AddStableLocationModPlugin" | ||
} |
37 changes: 37 additions & 0 deletions
37
src/mod/addstablelocations/AddStableLocationCampaignPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package mod.addstablelocations; | ||
|
||
import com.fs.starfarer.api.PluginPick; | ||
import com.fs.starfarer.api.campaign.BaseCampaignPlugin; | ||
import com.fs.starfarer.api.campaign.InteractionDialogPlugin; | ||
import com.fs.starfarer.api.campaign.PlanetAPI; | ||
import com.fs.starfarer.api.campaign.SectorEntityToken; | ||
import com.fs.starfarer.api.campaign.StarSystemAPI; | ||
|
||
import mod.addstablelocations.utilities.JSONUtils; | ||
|
||
|
||
public class AddStableLocationCampaignPlugin extends BaseCampaignPlugin{ | ||
|
||
// make it safe to remove from game | ||
public boolean isTransient(){return true;} | ||
|
||
@Override | ||
public PluginPick<InteractionDialogPlugin> pickInteractionDialogPlugin(SectorEntityToken interactionTarget) { | ||
if (interactionTarget instanceof PlanetAPI) { | ||
PlanetAPI planet = (PlanetAPI)interactionTarget; | ||
StarSystemAPI system = planet.getStarSystem(); | ||
if (system != null && planet == system.getStar()){ | ||
if(!planet.getSpec().isBlackHole()){ | ||
if (JSONUtils.loadBoolean(JSONUtils.getModConfig(), "AllowStar") == true){ | ||
return new PluginPick<InteractionDialogPlugin>(new StarDialogPluginImpl(), PickPriority.CORE_GENERAL); | ||
} | ||
}else{ | ||
if (JSONUtils.loadBoolean(JSONUtils.getModConfig(), "AllowBlackHole") == true){ | ||
return new PluginPick<InteractionDialogPlugin>(new BlackHoleDialogPluginImpl(), PickPriority.CORE_GENERAL); | ||
} | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/mod/addstablelocations/AddStableLocationModPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package mod.addstablelocations; | ||
|
||
import com.fs.starfarer.api.BaseModPlugin; | ||
import com.fs.starfarer.api.Global; | ||
|
||
|
||
public class AddStableLocationModPlugin extends BaseModPlugin { | ||
|
||
public void onGameLoad(boolean newGame) { | ||
Global.getSector().registerPlugin(new AddStableLocationCampaignPlugin()); | ||
} | ||
} |
Oops, something went wrong.