1using System.Collections.Generic;
35 public List<string>
idOther =
new List<string>();
93 mat = t?.material.id ?? (-1);
100 string text = CatName(
id);
105 text = text +
", " + CatName(
item);
108 return "ingCat".lang(text);
111 string text3 = (
tag.IsEmpty() ?
"" : (
"(" + (
"tag_" +
tag).lang() +
")"));
114 foreach (
string item2
in idOther)
119 return text2 + text3;
120 static string CatName(
string id)
143 if (t.
id ==
id || t.
source._origin ==
id)
147 foreach (
string item2
in idOther)
149 if (t.id ==
id || t.source._origin == item2)
158 public static Dictionary<string, Recipe>
recipeCache =
new Dictionary<string, Recipe>();
287 return tileRow._tiles.Length > 1;
299 if (recipeSource !=
null)
301 recipe =
Create(recipeSource);
314 recipe.idMat =
idMat;
320 recipe.VirtualBlock =
true;
329 if (recipeSource ==
null)
335 id = recipeSource.
id,
343 Debug.LogError(
"expection: invalid ingredient " + t);
354 foreach (
Ingredient ingredient
in orCreate.ingredients)
357 if (ingredient == orCreate.ingredients[0])
370 case "factory_floor":
371 case "factory_block":
373 case "factory_platform":
395 return -(num - 4) * 10;
397 num2 +=
EClass.
curve(-num, 10, 20, 80) / 10 * 10 + 10;
400 num2 += (int)Mathf.Sqrt(
RecipeLv - 1) * 10;
551 Msg.
Say(
"crafted", thing);
610 public virtual void Build(
Chara chara,
Card t,
Point pos,
int mat,
int dir,
int altitude,
int bridgeHeight)
617 pos.cell.isModified =
true;
642 chara.
Kick(
item, ignoreSelf:
false, karmaLoss:
false);
647 pos.cell.objDir = dir;
668 if (pos.
sourceObj.tileType.RemoveOnFloorChange)
769 text = (
"card_" +
source.
id).lang();
777 text =
"(" +
source.
row.GetField<
string>(
"id") +
")";
779 return text.ToTitleCase();
843 _dir = tileType.MaxAltitude - 1;
879 return IO.DeepCopy(
this);
899 if (
item.Num >= ingredient.
req)
921 if (!ingredient.
optional || thing !=
null)
925 num2 = thing.Num / ingredient.
req;
940 string text2 = reqSkill.Name +
" " + reqSkill.
Value;
947 return reqSkill.source.id * 10000 - reqSkill.
Value;
977 List<int> list =
new List<int>();
980 int item = ((ingredient.thing !=
null) ? ingredient.
thing.
uid : 0);
1002 if (quest !=
null && quest.
idRecipe ==
id)
1018 EClass.player.questTracker =
true;
1019 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
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)
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)
SourceMaterial.Row matBridge
List< Chara > ListCharas()
SourceFloor.Row sourceFloor
SourceFloor.Row sourceBridge
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false)
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)
void SetImage(Image image, Sprite sprite=null, int matCol=0, bool setNativeSize=true, int dir=0, int idSkin=0)
SourceCategory.Row Category
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
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)
UIItem AddHeaderTopic(string text, Sprite sprite=null)
UIItem AddText(string text, FontColor color=FontColor.DontChange)
void Space(int sizeY=0, int sizeX=1)