1using System.Collections.Generic;
41 public List<string>
idOther =
new List<string>();
102 mat = t?.material.id ?? (-1);
109 string text = CatName(
id);
114 text = text +
", " + CatName(
item);
117 return "ingCat".lang(text);
120 string text3 = (
tag.IsEmpty() ?
"" : (
"(" + (
"tag_" +
tag).lang() +
")"));
123 foreach (
string item2
in idOther)
128 return text2 + text3;
129 static string CatName(
string id)
161 if (t.
id ==
id || t.
source._origin ==
id)
165 foreach (
string item2
in idOther)
167 if (t.id ==
id || t.source._origin == item2)
176 public static Dictionary<string, Recipe>
recipeCache =
new Dictionary<string, Recipe>();
305 return tileRow._tiles.Length > 1;
317 if (recipeSource !=
null)
319 recipe =
Create(recipeSource);
332 recipe.idMat =
idMat;
338 recipe.VirtualBlock =
true;
347 if (recipeSource ==
null)
353 id = recipeSource.
id,
361 Debug.LogError(
"expection: invalid ingredient " + t);
372 foreach (
Ingredient ingredient
in orCreate.ingredients)
375 if (ingredient == orCreate.ingredients[0])
388 case "factory_floor":
389 case "factory_block":
391 case "factory_platform":
413 return -(num - 4) * 10;
415 num2 +=
EClass.
curve(-num, 10, 20, 80) / 10 * 10 + 10;
418 num2 += (int)Mathf.Sqrt(
RecipeLv - 1) * 10;
569 Msg.
Say(
"crafted", thing);
628 public virtual void Build(
Chara chara,
Card t,
Point pos,
int mat,
int dir,
int altitude,
int bridgeHeight)
635 pos.cell.isModified =
true;
660 chara.
Kick(
item, ignoreSelf:
false, karmaLoss:
false);
665 pos.cell.objDir = dir;
686 if (pos.
sourceObj.tileType.RemoveOnFloorChange)
787 text = (
"card_" +
source.
id).lang();
795 text =
"(" +
source.
row.GetField<
string>(
"id") +
")";
797 return text.ToTitleCase();
861 _dir = tileType.MaxAltitude - 1;
897 return IO.DeepCopy(
this);
917 if (
item.Num >= ingredient.
req)
939 if (!ingredient.
optional || thing !=
null)
943 num2 = thing.Num / ingredient.
req;
958 string text2 = reqSkill.Name +
" " + reqSkill.
Value;
965 return reqSkill.source.id * 10000 - reqSkill.
Value;
995 List<int> list =
new List<int>();
998 int item = ((ingredient.thing !=
null) ? ingredient.
thing.
uid : 0);
1020 if (quest !=
null && quest.
idRecipe ==
id)
1036 EClass.player.questTracker =
true;
1037 EClass.
ui.widgets.ActivateWidget(
"QuestTracker");
virtual bool IsRoofEditMode(Card c=null)
BaseTileSelector tileSelector
RenderData rendererFloorMarker
RenderData rendererBlockMarker
void SetRoofHeight(MeshPassParam _param, Cell _cell, int _cx, int _cz, int h=0, int altitude=0, int dirWall=-1, bool ignoreAltitudeY=false)
virtual MoveResult _Move(Point p, MoveType type=MoveType.Walk)
ElementContainerCard elements
bool HasElement(int ele, int req=1)
SourceMaterial.Row DyeMat
SourceMaterial.Row material
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
virtual void SetBlessedState(BlessedState s)
SourceCategory.Row category
SourceMaterial.Row matObj
void HoldCard(Card t, int num=-1)
void Kick(Point p, bool ignoreSelf=false, bool checkWall=true)
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
static ColorProfile Colors
static int curve(int a, int start, int step, int rate=75)
static SourceManager sources
static BaseGameScreen screen
static GameSetting setting
Element GetOrCreateElement(Element ele)
void SetBridge(int x, int z, int height=0, int idMat=0, int idBridge=0, int dir=0)
void SetBlockDir(int x, int z, int dir)
void MineObjSound(Point point)
void SetFloor(int x, int z, int idMat=0, int idFloor=0)
void SetBlock(int x, int z, int idMat=0, int idBlock=0)
void SetRoofBlock(int x, int z, int idMat, int idBlock, int dir, int height)
void SetObj(int x, int z, int id=0, int value=1, int dir=0)
void Add(Point point, float tile=0f, float color=0f)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Thing DropReward(Thing t, bool silent=false)
SourceMaterial.Row matBlock
SourceMaterial.Row matFloor
SourceBlock.Row sourceBlock
ref Vector3 Position(int height)
List< Card > ListCards(bool includeMasked=false)
RenderParam ApplyAnime(RenderParam p)
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
SourceMaterial.Row matBridge
List< Chara > ListCharas()
SourceFloor.Row sourceFloor
SourceFloor.Row sourceBridge
ThingStack ListThingStack(Recipe.Ingredient ing, StockSearchMode searchMode)
Quest Start(string id, string idGlobalChara)
static Quest Create(string _id, string _idPerson=null, Chara c=null)
override void BuildIngredientList()
Dictionary< string, List< int > > lastIngredients
HashSet< string > craftedRecipes
static RecipeSource Get(string id)
static Dictionary< string, RecipeSource > dict
Dictionary< string, int > knownRecipes
List< Recipe.Ingredient > GetIngredients()
bool CanSetThing(Thing t)
void SetThing(Thing t=null)
bool IsValidIngredient(Thing t)
SourceMaterial.Row DefaultMaterial
void SetTextDifficulty(UIText text)
virtual void WriteNote(UINote n)
void WriteReqSkill(UINote n)
void WriteReqFactory(UINote n, bool hasFactory=true)
static Recipe Create(Thing t)
virtual void OnRenderMarker(Point point, bool active, HitResult result, bool main, int dir, int bridgeHeight)
virtual bool RequireIngredients
virtual string GetIdThing()
bool HasSameTile(Point point, int dir, int altitude, int bridgeHeight)
virtual IRenderer GetRenderer()
virtual void SetDir(int d)
virtual TileType tileType
static void DropIngredients(string id, string idMatMain, int num=1)
virtual void OnSelected()
virtual RenderRow renderRow
void SaveLastIngredients()
List< Ingredient > ingredients
virtual void Build(TaskBuild task)
virtual bool IsFloorOrBridge
void BuildIngredientList(Thing t)
QuestTrackCraft GetQuestTrack()
virtual SourceMaterial.Row GetMainMaterial()
static Dictionary< string, Recipe > recipeCache
static Recipe Create(RecipeSource _source, int idMat=-1, Thing ing=null)
void ToggleTrack(QuestTrackCraft quest)
void TryGetFirstTimeBonus()
virtual void Build(Chara chara, Card t, Point pos, int mat, int dir, int altitude, int bridgeHeight)
virtual void OnChangeIngredient()
virtual string GetDetail()
virtual Thing Craft(BlessedState blessed, bool sound=false, List< Thing > ings=null, TraitCrafter crafter=null, bool model=false)
static Recipe GetOrCreate(string id)
virtual void SetImage(Image icon)
virtual SourceMaterial.Row GetColorMaterial()
virtual void BuildIngredientList()
BaseTileSelector tileSelector
BaseTileSelector.BoxType GetBoxType()
virtual void OnChangeAltitude(int a)
virtual bool ShouldShowHighlight(HitResult r)
virtual Recipe Duplicate()
void Draw(RenderParam p, int tile)
void DrawRepeat(RenderParam p, int count, float size, bool skipFirst=false)
int GetColorInt(SourceMaterial.Row mat)
SourceCategory.Row Category
void SetImage(Image image, Sprite sprite=null, int matCol=0, bool setNativeSize=true, int dir=0, int idSkin=0, Card card=null)
virtual RenderParam GetRenderParam(SourceMaterial.Row mat, int dir, Point point=null, int bridgeHeight=-1)
SourceMaterial.Row DefaultMaterial
Color GetTextColor(FontColor fontColor)
Dictionary< string, CardRow > map
string GetText(string id="name", bool returnNull=false)
SourceCategory categories
static Thing CreateBlock(int id, int idMat)
static Thing CreateObj(int id, int idMat)
static Thing CreateFloor(int id, int idMat, bool platform=false)
static Thing Create(string id, int idMat=-1, int lv=-1)
virtual BaseTileSelector.BoxType BoxType
static TileTypeBridge Bridge
static TileTypeSlope Slope
virtual bool IsWallOrFence
virtual bool AltitudeAsDir
virtual bool IsFloorOrBridge
virtual bool CanRotate(bool buildMode)
virtual BlockRenderMode blockRenderMode
virtual bool ChangeBlockDir
virtual void OnCrafted(Recipe recipe, List< Thing > ings)
UIItem AddHeaderTopic(string text, Sprite sprite=null)
UIItem AddText(string text, FontColor color=FontColor.DontChange)
void Space(int sizeY=0, int sizeX=1)