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)
156 if (t.
id ==
id || t.
source._origin ==
id)
160 foreach (
string item2
in idOther)
162 if (t.id ==
id || t.source._origin == item2)
171 public static Dictionary<string, Recipe>
recipeCache =
new Dictionary<string, Recipe>();
300 return tileRow._tiles.Length > 1;
312 if (recipeSource !=
null)
314 recipe =
Create(recipeSource);
327 recipe.idMat =
idMat;
333 recipe.VirtualBlock =
true;
342 if (recipeSource ==
null)
348 id = recipeSource.
id,
356 Debug.LogError(
"expection: invalid ingredient " + t);
367 foreach (
Ingredient ingredient
in orCreate.ingredients)
370 if (ingredient == orCreate.ingredients[0])
383 case "factory_floor":
384 case "factory_block":
386 case "factory_platform":
408 return -(num - 4) * 10;
410 num2 +=
EClass.
curve(-num, 10, 20, 80) / 10 * 10 + 10;
413 num2 += (int)Mathf.Sqrt(
RecipeLv - 1) * 10;
564 Msg.
Say(
"crafted", thing);
623 public virtual void Build(
Chara chara,
Card t,
Point pos,
int mat,
int dir,
int altitude,
int bridgeHeight)
630 pos.cell.isModified =
true;
655 chara.
Kick(
item, ignoreSelf:
false, karmaLoss:
false);
660 pos.cell.objDir = dir;
681 if (pos.
sourceObj.tileType.RemoveOnFloorChange)
782 text = (
"card_" +
source.
id).lang();
790 text =
"(" +
source.
row.GetField<
string>(
"id") +
")";
792 return text.ToTitleCase();
856 _dir = tileType.MaxAltitude - 1;
892 return IO.DeepCopy(
this);
912 if (
item.Num >= ingredient.
req)
934 if (!ingredient.
optional || thing !=
null)
938 num2 = thing.Num / ingredient.
req;
953 string text2 = reqSkill.Name +
" " + reqSkill.
Value;
960 return reqSkill.source.id * 10000 - reqSkill.
Value;
990 List<int> list =
new List<int>();
993 int item = ((ingredient.thing !=
null) ? ingredient.
thing.
uid : 0);
1015 if (quest !=
null && quest.
idRecipe ==
id)
1031 EClass.player.questTracker =
true;
1032 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)
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
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)