Added massive amount of partially-unfinished content to recipe menu
This commit is contained in:
@@ -2,7 +2,7 @@ package io.anuke.mindustry.game;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
|
||||
/**Base interface for an unlockable content type.*/
|
||||
/**Base interface for a content type that is loaded in {@link io.anuke.mindustry.core.ContentLoader}.*/
|
||||
public interface Content {
|
||||
|
||||
/**Returns the type name of this piece of content.
|
||||
@@ -12,8 +12,7 @@ public interface Content {
|
||||
/**Returns a list of all instances of this content.*/
|
||||
Array<? extends Content> getAll();
|
||||
|
||||
/**Called after all content is created. Use for loading texture regions and other data.
|
||||
* Do not use to load regions!*/
|
||||
/**Called after all content is created. Do not use to load regions or texture data!*/
|
||||
default void init(){}
|
||||
|
||||
/**Called after all content is created, only on non-headless versions.
|
||||
|
||||
@@ -25,11 +25,13 @@ public class ContentDatabase {
|
||||
return set.contains(content.getContentName());
|
||||
}
|
||||
|
||||
/**Makes this piece of content 'unlocked'.
|
||||
* If this piece of content is already unlocked, nothing changes.
|
||||
/**Makes this piece of content 'unlocked', if possible.
|
||||
* If this piece of content is already unlocked or cannot be unlocked due to dependencies, nothing changes.
|
||||
* Results are not saved until you call {@link #save()}.
|
||||
* @return whether or not this content was newly unlocked.*/
|
||||
public boolean unlockContent(UnlockableContent content){
|
||||
if(!content.canBeUnlocked()) return false;
|
||||
|
||||
if(!unlocked.containsKey(content.getContentTypeName())){
|
||||
unlocked.put(content.getContentTypeName(), new ObjectSet<>());
|
||||
}
|
||||
@@ -38,6 +40,7 @@ public class ContentDatabase {
|
||||
|
||||
//fire unlock event so other classes can use it
|
||||
if(ret){
|
||||
content.onUnlock();
|
||||
Events.fire(UnlockEvent.class, content);
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package io.anuke.mindustry.game;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
|
||||
import static io.anuke.mindustry.Vars.control;
|
||||
|
||||
/**Base interface for an unlockable content type.*/
|
||||
public interface UnlockableContent extends Content{
|
||||
|
||||
@@ -22,4 +24,29 @@ public interface UnlockableContent extends Content{
|
||||
|
||||
/**Called when this content is unlocked. Use this to unlock other related content.*/
|
||||
default void onUnlock(){}
|
||||
|
||||
/**Whether this content is always hidden in the content info dialog.*/
|
||||
default boolean isHidden(){
|
||||
return false;
|
||||
}
|
||||
|
||||
/**Lists the content that must be unlocked in order for this specific content to become unlocked. May return null.*/
|
||||
default UnlockableContent[] getDependencies(){
|
||||
return null;
|
||||
}
|
||||
|
||||
/**Returns whether dependencies are satisfied for unlocking this content.*/
|
||||
default boolean canBeUnlocked(){
|
||||
UnlockableContent[] depend = getDependencies();
|
||||
if(depend == null){
|
||||
return true;
|
||||
}else{
|
||||
for(UnlockableContent cont : depend){
|
||||
if(!control.database().isUnlocked(cont)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class WaveCreator{
|
||||
unitAmount = 4;
|
||||
groupAmount = 2;
|
||||
effect = StatusEffects.overdrive;
|
||||
items = new ItemStack(Items.thermite, 100);
|
||||
items = new ItemStack(Items.pyratite, 100);
|
||||
end = 130;
|
||||
}},
|
||||
|
||||
@@ -139,7 +139,7 @@ public class WaveCreator{
|
||||
|
||||
new SpawnGroup(UnitTypes.monsoon){{
|
||||
begin = 53;
|
||||
ammoItem = Items.thermite;
|
||||
ammoItem = Items.pyratite;
|
||||
unitAmount = 2;
|
||||
unitScaling = 3;
|
||||
spacing = 4;
|
||||
|
||||
Reference in New Issue
Block a user