Elin Decompiled Documentation EA 23.331 Nightly
Loading...
Searching...
No Matches
ThingGen Class Reference
Inheritance diagram for ThingGen:
CardGen EClass

Static Public Member Functions

static Thing _Create (string id, int idMat=-1, int lv=-1)
 
static Thing TestCreate ()
 
static Thing CreateCurrency (int a, string id="money")
 
static Thing CreateParcel (string idLang=null, params Thing[] things)
 
static Thing Create (string id, int idMat=-1, int lv=-1)
 
static Thing Create (string id, string idMat, int lv=-1)
 
static Thing CreateFromFilter (string id, int lv=-1)
 
static Thing CreateRawMaterial (SourceMaterial.Row m)
 
static Thing CreateFromCategory (string idCat, int lv=-1)
 
static Thing CreateFromTag (string idTag, int lv=-1)
 
static Thing CreateBill (int pay, bool tax)
 
static Thing CreateBlock (int id, int idMat)
 
static Thing CreateFloor (int id, int idMat, bool platform=false)
 
static Thing CreateDeco (int id, int idMat)
 
static Thing CreateObj (int id, int idMat)
 
static Thing CreateMap (string idSource=null, int lv=-1)
 
static Thing CreatePlan (int ele)
 
static Thing CreateRecipe (string id)
 
static Thing CreateSpellbook (string alias, int num=1)
 
static Thing CreateSpellbook (int ele, int num=1, int charge=-1)
 
static Thing CreateRedBook (string id, int num=1)
 
static Thing CreateSkillbook (int ele, int num=1)
 
static Thing CreateScroll (int ele, int num=1)
 
static Thing Createジュアさまの薄い本 ()
 
static Thing CreateUsuihon (Religion faith)
 
static Thing CreateRune (int ele, int v, bool free=false)
 
static Thing CreateRod (int ele, int charge=-1)
 
static Thing CreatePotion (int ele, int num=1)
 
static Thing CreatePerfume (int ele, int num=1)
 
static Thing CreateCassette (int id)
 
static Thing CreateLetter (string idLetter)
 
static Thing CreateCardboardBox (int uidZone=-1)
 
static Thing CreateTreasure (string id, int lv, TreasureType type=TreasureType.Map)
 
static void CreateTreasureContent (Thing t, int lv, TreasureType type, bool clearContent)
 
static void TryLickChest (Thing chest)
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Additional Inherited Members

- Static Public Attributes inherited from EClass
static Core core
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 4 of file ThingGen.cs.

Member Function Documentation

◆ _Create()

static Thing ThingGen._Create ( string  id,
int  idMat = -1,
int  lv = -1 
)
inlinestatic

Definition at line 6 of file ThingGen.cs.

7 {
8 Thing thing = new Thing();
9 CardRow s = EClass.sources.cards.map.TryGetValue(id);
10 if (s == null)
11 {
12 Debug.LogError("exception: Item not found:" + id);
13 id = "869";
14 s = EClass.sources.cards.map.TryGetValue(id);
15 }
16 if (s.isOrigin)
17 {
18 id = SpawnListThing.Get("origin_" + id, (SourceThing.Row a) => a.origin == s).Select(lv)?.id ?? EClass.sources.cards.rows.Where((CardRow a) => a.origin == s).First().id;
19 }
20 if (lv < 1)
21 {
22 lv = 1;
23 }
24 thing.Create(id, idMat, lv);
25 if (thing.trait is TraitAmmo)
26 {
27 thing.SetNum(EClass.rnd(20) + 10);
28 }
29 return thing;
30 }
CardRow origin
Definition: CardRow.cs:49
string id
Definition: CardRow.cs:7
bool isOrigin
Definition: CardRow.cs:52
Thing SetNum(int a)
Definition: Card.cs:3669
Trait trait
Definition: Card.cs:54
void Create(string _id, int _idMat=-1, int genLv=-1)
Definition: Card.cs:2906
Definition: EClass.cs:6
static int rnd(long a)
Definition: EClass.cs:59
static SourceManager sources
Definition: EClass.cs:43
List< CardRow > rows
Definition: SourceCard.cs:7
Dictionary< string, CardRow > map
Definition: SourceCard.cs:9
SourceCard cards
static SpawnList Get(string id, Func< SourceThing.Row, bool > func)
CardRow Select(int lv=-1, int levelRange=-1)
Definition: SpawnList.cs:139
Definition: Thing.cs:8

References SourceManager.cards, Card.Create(), Debug, SpawnListThing.Get(), CardRow.id, CardRow.isOrigin, SourceCard.map, CardRow.origin, EClass.rnd(), SourceCard.rows, SpawnList.Select(), Card.SetNum(), EClass.sources, and Card.trait.

Referenced by Create(), CreateFromCategory(), CreateFromFilter(), CreateFromTag(), and TestCreate().

◆ Createジュアさまの薄い本()

static Thing ThingGen.Createジュアさまの薄い本 ( )
inlinestatic

Definition at line 197 of file ThingGen.cs.

198 {
200 }
static Game game
Definition: EClass.cs:9
ReligionManager religions
Definition: Game.cs:159
ReligionHealing Healing
static Thing CreateUsuihon(Religion faith)
Definition: ThingGen.cs:202

References CreateUsuihon(), EClass.game, ReligionManager.Healing, and Game.religions.

Referenced by ReligionManager.ジュアさまの薄い本をください().

◆ Create() [1/2]

static Thing ThingGen.Create ( string  id,
int  idMat = -1,
int  lv = -1 
)
inlinestatic

Definition at line 53 of file ThingGen.cs.

54 {
55 return _Create(id, idMat, lv);
56 }
static Thing _Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:6

References _Create().

Referenced by Game._Create(), InvOwnerRecycle._OnProcess(), TraitGodStatue._OnUse(), TraitShrine._OnUse(), Card.Add(), ThingContainer.AddCurrency(), Card.AddThing(), Zone.AddThing(), GameDate.AdvanceDay(), GameDate.AdvanceYear(), RecipeCard.Build(), DropdownGrid.BuildIngredients(), Map.Burn(), AI_Shopping.Buy(), Zone.ClaimZone(), DramaOutcome.convert_Jure(), TraitCrafter.Craft(), RecipeCard.Craft(), CustomThingContent.Create(), Create(), CreateBill(), CreateBlock(), SourceMaterial.Row.CreateByProduct(), CreateCardboardBox(), CreateCassette(), CreateCurrency(), CreateDeco(), InvOwner.CreateDefaultContainer(), InvOwnerChangeMaterial.CreateDefaultContainer(), InvOwnerChangeRarity.CreateDefaultContainer(), Player.CreateEquip(), CreateFloor(), CreateLetter(), CreateMap(), RecipeCard.CreateMold(), CreateObj(), CreateParcel(), CreatePerfume(), CreatePlan(), CreatePotion(), CreateRawMaterial(), CreateRecipe(), CreateRedBook(), CreateRod(), CreateRune(), CreateScroll(), CreateSkillbook(), CreateSpellbook(), Trait.CreateStock(), CreateTreasure(), CreateTreasureContent(), CreateUsuihon(), FactionBranch.DailyOutcome(), QuestDeliver.Deliver(), Card.Die(), Chara.DoHostileAction(), Religion.DoPunish(), Map.DropBlockComponent(), Recipe.DropIngredients(), Quest.DropReward(), Card.Duplicate(), DramaOutcome.duponne_capture(), DramaOutcome.duponne_reward(), Card.EjectSockets(), Chara.EQ_ID(), Chara.EQ_Item(), ZonePreEnterBoutWin.Execute(), ZonePreEnterDigStairs.Execute(), DramaOutcome.fiama_gold(), DramaOutcome.fiama_starter_gift(), AI_Fuck.Finish(), CoreDebug.Fix_LostCore(), Zone.Generate(), FactionBranch.GenerateGarbage(), DNA.GenerateGene(), Zone_SnowGrave.GenerateGrave(), DramaOutcome.get_scratch(), FactionBranch.GetDailyIncome(), AI_Shear.GetFur(), FortuneRollData.GetPrize(), CraftUtil.GetRandomLoveLunchIngredient(), MiniGame.GetSlotReward(), DramaOutcome.give_sketch_reward(), QuestDebt.GiveBill(), QuestDebt.GiveReward(), TaskHarvest.HarvestThing(), join_party(), DramaOutcome.ListFelmeraBarter(), CraftUtil.MakeBloodSample(), CraftUtil.MakeDarkSoup(), CraftUtil.MakeDish(), Card.MakeEgg(), AI_Fish.Makefish(), Chara.MakeGrave(), CraftUtil.MakeLoveLunch(), Card.MakeMilk(), TraitSeed.MakeRandomSeed(), AI_OpenGambleChest.MakeReward(), TraitSeed.MakeSeed(), SurvivalManager.MeteorThing(), Map.MineBlock(), Map.MineObj(), CraftUtil.MixIngredients(), Chara.MutateRandom(), DramaOutcome.nerun_gift(), DramaOutcome.nerun_gift2(), DramaOutcome.nerun_gift3(), Zone_Void.OnActivate(), Faction.OnAdvanceMonth(), Trait.OnBarter(), ConTransmuteMimic.OnBeforeStart(), QuestVernis.OnChangePhase(), TraitBrewery.OnChildDecay(), ContentCodex.OnClickGetCard(), QuestNasu.OnComplete(), TraitParchmentBottle.OnCreate(), FactionBranch.OnCreate(), TaskChopWood.OnCreateProgress(), TaskHarvest.OnCreateProgress(), QuestCraft.OnDropReward(), QuestDefense.OnDropReward(), QuestRandom.OnDropReward(), QuestWedding.OnDropReward(), SurvivalManager.OnExpandFloor(), Zone_TestRoom.OnGenerateMap(), MapGenDungen.OnGenerateTerrain(), GrowSystem.OnMineObj(), GrowSystemCha.OnMineObj(), GrowSystemFlower.OnMineObj(), GrowSystemHerb.OnMineObj(), GrowSystemWeed.OnMineObj(), GrowSystemWheat.OnMineObj(), SurvivalManager.OnMineWreck(), QuestCraft.OnProgressComplete(), TaskDig.OnProgressComplete(), TaskMine.OnProgressComplete(), FactionBranch.OnSimulateDay(), QuestDeliver.OnStart(), QuestFiamaLock.OnStart(), TraitGiftJure.OnUse(), TraitGiftNewYear.OnUse(), TraitGiftPack.OnUse(), TraitPlamoBox.OnUse(), TraitStairsLocked.OnUse(), TraitPotionEmpty.OnUse(), ZoneEventDefenseGame.OnVisit(), DramaManager.ParseLine(), InvOwnerDeliver.PayBill(), ActDreamBug.Perform(), ActMoneyDump.Perform(), ActMoneySlap.Perform(), Chara.PickOrDrop(), Zone_Dungeon.PlaceRail(), TraitGacha.PlayGacha(), GrowSystem.PopHarvest(), GenRoom.Populate(), TraitBaseContainer.Prespawn(), TraitContainerCurrency.Prespawn(), TraitToolBelt.Prespawn(), FoodEffect.Proc(), ActEffect.Proc(), DramaOutcome.PutOutFire(), DramaOutcome.QuestDefense_1(), DramaOutcome.QuestSharedContainer_Drop1(), CoreDebug.QuickStart(), FactionBranch.ReceivePackages(), ReligionManager.Reforge(), CoreDebug.Reset_LoytelDebt(), Chara.RestockEquip(), Chara.RestockInventory(), SerializedCards.Restore(), AI_Craft_Snowman.Run(), AI_Idle.Run(), AI_OpenGambleChest.Run(), AI_PlayMusic.Run(), AI_Steal.Run(), TaskCullLife.Run(), CoreDebug.SetStartStockpile(), GameDate.ShipLetter(), GameDate.ShipRandomPackages(), Chara.ShowDialog(), CoreDebug.Spawn(), Zone.SpawnAltar(), ReligionExtension.SpawnAltar(), CoreDebug.SpawnFigure(), Card.SpawnLoot(), Zone.SpawnLostItems(), SurvivalManager.StartRaid(), AI_PlayMusic.ThrowReward(), BiomeProfile.ClusterThing.TryCreate(), TraitSwitch.TryDisarmTrap(), Chara.TryDropBossLoot(), Zone.TryGenerateShrine(), Recipe.TryGetFirstTimeBonus(), GrowSystem.TryPick(), Chara.TryPoisonPotion(), Map.TryShatter(), DramaOutcome.Tutorial1(), TraitFoodEgg.Update(), TraitSpotBiome.Update(), ActionMode.UpdateInput(), CoreDebug.UpdateInput(), Chara.Vomit(), and ActEffect.Wish().

◆ Create() [2/2]

static Thing ThingGen.Create ( string  id,
string  idMat,
int  lv = -1 
)
inlinestatic

Definition at line 58 of file ThingGen.cs.

59 {
60 return Create(id, idMat.IsEmpty() ? (-1) : EClass.sources.materials.alias[idMat].id, lv);
61 }
SourceMaterial materials
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53

References Create(), SourceManager.materials, and EClass.sources.

◆ CreateBill()

static Thing ThingGen.CreateBill ( int  pay,
bool  tax 
)
inlinestatic

Definition at line 85 of file ThingGen.cs.

86 {
87 Thing thing = Create(tax ? "bill_tax" : "bill");
88 thing.c_bill = pay;
89 if (tax)
90 {
91 EClass.player.stats.taxBills += thing.c_bill;
93 }
94 else
95 {
96 EClass.player.unpaidBill += thing.c_bill;
97 }
98 return thing;
99 }
int c_bill
Definition: Card.cs:1321
static Player player
Definition: EClass.cs:13
int taxBills
Definition: Player.cs:975

References Card.c_bill, Create(), EClass.player, and Player.taxBills.

Referenced by Faction.OnAdvanceMonth(), and GameDate.ShipPackages().

◆ CreateBlock()

static Thing ThingGen.CreateBlock ( int  id,
int  idMat 
)
inlinestatic

Definition at line 101 of file ThingGen.cs.

102 {
103 Thing thing = Create(EClass.sources.blocks.rows[id].idThing, idMat);
104 thing.refVal = id;
105 return thing;
106 }
SourceBlock blocks

References SourceManager.blocks, Create(), and EClass.sources.

Referenced by Recipe.Craft(), CustomThingContent.Create(), Map.DropBlockComponent(), and CoreDebug.QuickStart().

◆ CreateCardboardBox()

static Thing ThingGen.CreateCardboardBox ( int  uidZone = -1)
inlinestatic

Definition at line 252 of file ThingGen.cs.

253 {
254 Thing thing = Create("cardboard_box", new string[5] { "pine", "wood_birch", "wood_acacia", "oak", "cedar" }.RandomItem());
255 thing.things.DestroyAll();
256 Spatial spatial = ((uidZone == -1) ? null : EClass.game.spatials.map.TryGetValue(uidZone));
257 if (spatial != null)
258 {
259 thing.c_idRefName = "sender_header".lang("sender_post".lang(spatial.Name));
260 }
261 return thing;
262 }
ThingContainer things
Definition: Card.cs:39
SpatialManager spatials
Definition: Game.cs:153
GlobalSpatialList map
virtual string Name
Definition: Spatial.cs:509
void DestroyAll(Func< Thing, bool > funcExclude=null)

References Create(), ThingContainer.DestroyAll(), EClass.game, SpatialManager.map, Spatial.Name, Game.spatials, and Card.things.

Referenced by GameDate.ShipPackages(), and GameDate.ShipRandomPackages().

◆ CreateCassette()

static Thing ThingGen.CreateCassette ( int  id)
inlinestatic

Definition at line 238 of file ThingGen.cs.

239 {
240 Thing thing = Create("856");
241 thing.refVal = id;
242 return thing;
243 }

References Create().

Referenced by CustomThingContent.Create(), Trait.OnBarter(), QuestCurry.OnComplete(), and QuestDebt.OnStart().

◆ CreateCurrency()

static Thing ThingGen.CreateCurrency ( int  a,
string  id = "money" 
)
inlinestatic

◆ CreateDeco()

static Thing ThingGen.CreateDeco ( int  id,
int  idMat 
)
inlinestatic

Definition at line 116 of file ThingGen.cs.

117 {
118 _ = EClass.sources.decos.rows[id];
119 Thing thing = Create("deco", idMat);
120 thing.refVal = id;
121 return thing;
122 }
SourceDeco decos

References Create(), SourceManager.decos, and EClass.sources.

Referenced by Recipe.Craft().

◆ CreateFloor()

static Thing ThingGen.CreateFloor ( int  id,
int  idMat,
bool  platform = false 
)
inlinestatic

Definition at line 108 of file ThingGen.cs.

109 {
110 _ = EClass.sources.floors.rows[id];
111 Thing thing = Create(platform ? "platform" : "floor", idMat);
112 thing.refVal = id;
113 return thing;
114 }
SourceFloor floors

References Create(), SourceManager.floors, and EClass.sources.

Referenced by Recipe.Craft(), Map.DropBlockComponent(), SurvivalManager.OnMineWreck(), and CoreDebug.QuickStart().

◆ CreateFromCategory()

◆ CreateFromFilter()

static Thing ThingGen.CreateFromFilter ( string  id,
int  lv = -1 
)
inlinestatic

◆ CreateFromTag()

static Thing ThingGen.CreateFromTag ( string  idTag,
int  lv = -1 
)
inlinestatic

Definition at line 80 of file ThingGen.cs.

81 {
82 return _Create(SpawnListThing.Get("tag_" + idTag, (SourceThing.Row s) => s.tag.Contains(idTag)).Select(lv).id, -1, lv);
83 }

References _Create(), SpawnListThing.Get(), CardRow.id, and SpawnList.Select().

Referenced by CustomThingContent.Create(), FactionBranch.GenerateGarbage(), and GameDate.ShipRandomPackages().

◆ CreateLetter()

static Thing ThingGen.CreateLetter ( string  idLetter)
inlinestatic

Definition at line 245 of file ThingGen.cs.

246 {
247 Thing thing = Create("letter");
248 thing.SetStr(53, idLetter);
249 return thing;
250 }
void SetStr(string id, string value=null)
Definition: Card.cs:2600

References Create(), and Card.SetStr().

Referenced by CustomThingContent.Create(), and TraitGiftJure.OnUse().

◆ CreateMap()

static Thing ThingGen.CreateMap ( string  idSource = null,
int  lv = -1 
)
inlinestatic

Definition at line 132 of file ThingGen.cs.

133 {
134 if (idSource.IsEmpty())
135 {
137 }
138 if (lv == -1)
139 {
140 lv = 1 + EClass.rnd(EClass.rnd(50) + 1);
141 }
142 return Create("map");
143 }
new World world
Definition: Game.cs:177
SourceZone.Row GetRandomSiteSource()
Definition: Region.cs:200
Region region
Definition: World.cs:23

References Create(), EClass.game, Region.GetRandomSiteSource(), World.region, EClass.rnd(), and Game.world.

Referenced by CustomThingContent.Create(), and Trait.CreateStock().

◆ CreateObj()

static Thing ThingGen.CreateObj ( int  id,
int  idMat 
)
inlinestatic

Definition at line 124 of file ThingGen.cs.

125 {
126 _ = EClass.sources.objs.rows[id];
127 Thing thing = Create("obj", idMat);
128 thing.refVal = id;
129 return thing;
130 }
SourceObj objs

References Create(), SourceManager.objs, and EClass.sources.

Referenced by Recipe.Craft().

◆ CreateParcel()

static Thing ThingGen.CreateParcel ( string  idLang = null,
params Thing[]  things 
)
inlinestatic

Definition at line 42 of file ThingGen.cs.

43 {
44 Thing thing = Create("parcel");
45 foreach (Thing c in things)
46 {
47 thing.AddCard(c);
48 }
49 thing.c_idRefName = idLang.lang();
50 return thing;
51 }
Card AddCard(Card c)
Definition: Card.cs:3259

References Create().

Referenced by GameDate.AdvanceDay(), Chara.MutateRandom(), Faction.OnAdvanceMonth(), SurvivalManager.OnMineWreck(), and InvOwnerDeliver.PayBill().

◆ CreatePerfume()

static Thing ThingGen.CreatePerfume ( int  ele,
int  num = 1 
)
inlinestatic

Definition at line 231 of file ThingGen.cs.

232 {
233 Thing thing = Create("perfume").SetNum(num);
234 TraitPotion.Create(thing, ele);
235 return thing;
236 }
static void Create(Card owner, int ele)
Definition: TraitPotion.cs:15

References TraitPotion.Create(), Create(), and Card.SetNum().

Referenced by CustomThingContent.Create(), and Trait.OnBarter().

◆ CreatePlan()

static Thing ThingGen.CreatePlan ( int  ele)
inlinestatic

Definition at line 145 of file ThingGen.cs.

146 {
147 Thing thing = Create("book_plan");
148 thing.refVal = ele;
149 return thing;
150 }

References Create().

Referenced by CustomThingContent.Create(), and Trait.OnBarter().

◆ CreatePotion()

static Thing ThingGen.CreatePotion ( int  ele,
int  num = 1 
)
inlinestatic

Definition at line 224 of file ThingGen.cs.

225 {
226 Thing thing = Create("1163").SetNum(num);
227 TraitPotion.Create(thing, ele);
228 return thing;
229 }

References TraitPotion.Create(), Create(), and Card.SetNum().

Referenced by CustomThingContent.Create(), Trait.CreateStock(), Trait.OnBarter(), and QuestVernis.OnChangePhase().

◆ CreateRawMaterial()

static Thing ThingGen.CreateRawMaterial ( SourceMaterial::Row  m)
inlinestatic

Definition at line 68 of file ThingGen.cs.

69 {
70 Thing thing = Create(m.thing);
71 thing.ChangeMaterial(m.id);
72 return thing;
73 }
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3210

References Card.ChangeMaterial(), and Create().

Referenced by SourceMaterial.Row.CreateByProduct(), Map.MineFloor(), and DramaOutcome.QuestCraft_Drop1().

◆ CreateRecipe()

◆ CreateRedBook()

static Thing ThingGen.CreateRedBook ( string  id,
int  num = 1 
)
inlinestatic

Definition at line 175 of file ThingGen.cs.

176 {
177 Thing thing = Create("book").SetNum(num);
178 thing.SetStr(53, id);
179 thing.idSkin = (thing.trait as TraitBook).Item.skin;
180 return thing;
181 }

References Create(), Item, Card.SetNum(), and Card.SetStr().

Referenced by CustomThingContent.Create(), Player.CreateEquip(), DramaOutcome.duponne_reward(), Trait.OnBarter(), and CoreDebug.QuickStart().

◆ CreateRod()

static Thing ThingGen.CreateRod ( int  ele,
int  charge = -1 
)
inlinestatic

Definition at line 217 of file ThingGen.cs.

218 {
219 Thing thing = Create("rod");
220 TraitRod.Create(thing, ele, charge);
221 return thing;
222 }
static void Create(Card owner, int ele, int charge=-1)
Definition: TraitRod.cs:76

References TraitRod.Create(), and Create().

Referenced by CustomThingContent.Create(), Trait.CreateStock(), and SurvivalManager.OnMineWreck().

◆ CreateRune()

static Thing ThingGen.CreateRune ( int  ele,
int  v,
bool  free = false 
)
inlinestatic

Definition at line 209 of file ThingGen.cs.

210 {
211 Thing thing = Create(free ? "rune_free" : "rune");
212 thing.refVal = ele;
213 thing.encLV = v;
214 return thing;
215 }

References Create().

Referenced by CustomThingContent.Create(), and Trait.OnBarter().

◆ CreateScroll()

◆ CreateSkillbook()

static Thing ThingGen.CreateSkillbook ( int  ele,
int  num = 1 
)
inlinestatic

Definition at line 183 of file ThingGen.cs.

184 {
185 Thing thing = Create("book_skill").SetNum(num);
186 thing.refVal = ele;
187 return thing;
188 }

References Create(), and Card.SetNum().

Referenced by CustomThingContent.Create(), and Trait.OnBarter().

◆ CreateSpellbook() [1/2]

static Thing ThingGen.CreateSpellbook ( int  ele,
int  num = 1,
int  charge = -1 
)
inlinestatic

Definition at line 164 of file ThingGen.cs.

165 {
166 Thing thing = Create("spellbook").SetNum(num);
167 TraitSpellbook.Create(thing, ele);
168 if (charge != -1)
169 {
170 thing.SetCharge(charge);
171 }
172 return thing;
173 }
void SetCharge(int a)
Definition: Card.cs:4118

References TraitSpellbook.Create(), Create(), Card.SetCharge(), and Card.SetNum().

◆ CreateSpellbook() [2/2]

static Thing ThingGen.CreateSpellbook ( string  alias,
int  num = 1 
)
inlinestatic

Definition at line 159 of file ThingGen.cs.

160 {
161 return CreateSpellbook(EClass.sources.elements.alias[alias].id, num);
162 }
SourceElement elements
static Thing CreateSpellbook(string alias, int num=1)
Definition: ThingGen.cs:159

References CreateSpellbook(), SourceManager.elements, and EClass.sources.

Referenced by CustomThingContent.Create(), Player.CreateEquip(), CreateSpellbook(), Trait.CreateStock(), Trait.OnBarter(), and Chara.RestockEquip().

◆ CreateTreasure()

static Thing ThingGen.CreateTreasure ( string  id,
int  lv,
TreasureType  type = TreasureType::Map 
)
inlinestatic

Definition at line 264 of file ThingGen.cs.

265 {
266 Thing thing = Create(id, -1, lv);
267 CreateTreasureContent(thing, lv, type, clearContent: true);
268 return thing;
269 }
static void CreateTreasureContent(Thing t, int lv, TreasureType type, bool clearContent)
Definition: ThingGen.cs:271

References Create(), and CreateTreasureContent().

Referenced by FactionBranch.DailyOutcome(), ZoneEventSiege.OnKill(), and Chara.TryDropBossLoot().

◆ CreateTreasureContent()

static void ThingGen.CreateTreasureContent ( Thing  t,
int  lv,
TreasureType  type,
bool  clearContent 
)
inlinestatic

Definition at line 271 of file ThingGen.cs.

272 {
273 int miracleChance = lv;
274 int num = EClass.curve(lv, 20, 15);
275 bool flag = true;
276 bool flag2 = true;
277 int guaranteedMythical = ((type == TreasureType.BossQuest) ? 1 : 0);
278 ChangeSeed();
279 t.AddEditorTag(EditorTag.PreciousContainer);
280 if (clearContent)
281 {
282 t.things.DestroyAll();
283 }
284 switch (type)
285 {
286 case TreasureType.Map:
287 miracleChance += 50;
288 t.Add("money", EClass.rndHalf(1000 + num * 100));
289 t.Add("money2", EClass.rndHalf(Mathf.Min(3 + num / 10, 10)));
290 t.Add("medal", EClass.rnd(3));
291 TryAddScrubber(25);
292 break;
293 case TreasureType.BossNefia:
294 case TreasureType.BossQuest:
295 t.Add("money", EClass.rndHalf(500 + num * 50));
296 t.Add("plat", EClass.rndHalf(Mathf.Min(3 + num / 10, 15)));
297 t.Add("rp_random", 1, lv);
298 if (EClass.rnd(5) == 0)
299 {
300 t.Add("medal", EClass.rnd(3));
301 }
302 else if (EClass.rnd(3) == 0)
303 {
304 t.Add("map_treasure", 1, EClass.rndHalf(lv + 10));
305 }
306 else
307 {
308 t.Add("book_skill", 1, lv);
309 }
310 t.c_lockLv /= 2;
311 TryAddScrubber(5);
312 break;
313 case TreasureType.SurvivalRaid:
314 t.Add("plat", EClass.rndHalf(Mathf.Min(3 + num / 10, 15)));
315 t.Add("money2", EClass.rndHalf(Mathf.Min(3 + num / 10, 10)));
316 t.Add("medal", EClass.rndHalf(8));
317 t.Add("book_skill", 1, lv);
318 t.Add("book_skill", 1, lv);
319 t.c_lockLv /= 3;
320 TryAddScrubber(2);
321 break;
322 case TreasureType.RandomChest:
323 flag2 = false;
324 miracleChance /= 2;
325 if (miracleChance > 50)
326 {
327 miracleChance = 50;
328 }
329 if (EClass.rnd(2) == 0)
330 {
331 t.Add("money", EClass.rndHalf(10 + num * 25));
332 }
333 else if (EClass.rnd(2) == 0)
334 {
335 t.Add("money2", 1 + EClass.rnd(Mathf.Min(2 + num / 25, 5)));
336 }
337 else
338 {
339 t.Add("plat", 1 + EClass.rnd(Mathf.Min(2 + num / 25, 5)));
340 }
342 {
343 flag = false;
344 break;
345 }
346 if (EClass.rnd(10) == 0)
347 {
348 t.Add("map_treasure", 1, EClass.rndHalf(lv + 10));
349 }
350 if (EClass.rnd(3) == 0)
351 {
352 t.AddCard(Create("rp_random", -1, lv));
353 }
354 if (t.c_lockLv > 0 && EClass.rnd(3) == 0)
355 {
356 t.Add("medal");
357 }
358 TryAddScrubber(30);
359 break;
360 }
361 if (type == TreasureType.RandomChest && EClass.rnd(2) == 0)
362 {
363 t.AddCard(CreateFromCategory("junk", lv));
364 }
365 else if (EClass.rnd(3) == 0)
366 {
367 t.Add("rp_random", 1, lv);
368 }
369 else if (type != TreasureType.Map && EClass.rnd(2) == 0)
370 {
371 Thing thing = CreateFromCategory("furniture", lv);
372 if (!thing.IsContainer && (t.c_lockLv == 0 || thing.SelfWeight < 10000))
373 {
374 t.AddCard(thing);
375 }
376 }
377 else
378 {
379 t.AddCard(CreateFromCategory("junk", lv));
380 }
381 if (EClass.rnd(3) == 0)
382 {
383 t.Add("book_ancient", 1, lv);
384 }
385 if (t.c_lockLv > 0)
386 {
387 miracleChance += 20 + (int)Mathf.Sqrt(t.c_lockLv * 5);
388 }
389 if (flag)
390 {
391 SetRarity(100);
392 t.AddCard(CreateFromFilter("eq", lv));
393 if (flag2)
394 {
395 SetRarity(20);
396 t.AddCard(CreateFromFilter("eq", lv));
397 }
398 }
399 Rand.SetSeed();
400 static void ChangeSeed()
401 {
404 }
405 void SetRarity(int mtp)
406 {
407 ChangeSeed();
408 Rarity rarity = ((miracleChance * mtp / 100 < EClass.rnd(100)) ? Rarity.Superior : ((EClass.rnd(20) == 0) ? Rarity.Mythical : Rarity.Legendary));
409 if (guaranteedMythical > 0)
410 {
411 guaranteedMythical--;
412 rarity = Rarity.Mythical;
413 }
415 {
416 rarity = rarity
417 });
418 }
419 void TryAddScrubber(int chance)
420 {
421 if (EClass.rnd(chance) == 0)
422 {
423 Thing thing2 = Create("scrubber");
424 thing2.rarity = Rarity.Legendary;
425 thing2.elements.SetBase(770, 1 + EClass.rnd(EClass.rnd(Mathf.Min(10 + (int)Mathf.Sqrt(lv) * 2, 30) + 1)));
426 t.AddThing(thing2);
427 }
428 }
429 }
EditorTag
Definition: EditorTag.cs:2
Rarity
Definition: Rarity.cs:2
TreasureType
Definition: TreasureType.cs:2
static void Set(CardBlueprint _bp=null)
ElementContainerCard elements
Definition: Card.cs:42
int c_lockLv
Definition: Card.cs:991
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3273
void AddEditorTag(EditorTag tag)
Definition: Card.cs:2738
Thing Add(string id, int num=1, int lv=1)
Definition: Card.cs:3250
bool IsContainer
Definition: Card.cs:2141
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
static Zone _zone
Definition: EClass.cs:21
static int rndHalf(int a)
Definition: EClass.cs:97
Element SetBase(string alias, int v, int potential=0)
int seed
Definition: Game.cs:201
int seedChest
Definition: Player.cs:1011
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:44
static Thing CreateFromFilter(string id, int lv=-1)
Definition: ThingGen.cs:63
static Thing CreateFromCategory(string idCat, int lv=-1)
Definition: ThingGen.cs:75
override int SelfWeight
Definition: Thing.cs:64

References EClass._zone, Card.Add(), Card.AddCard(), Card.AddEditorTag(), Card.AddThing(), Card.c_lockLv, Create(), CreateFromCategory(), CreateFromFilter(), EClass.curve(), ThingContainer.DestroyAll(), Card.elements, EClass.game, Card.IsContainer, EClass.player, EClass.rnd(), EClass.rndHalf(), Game.seed, Player.seedChest, Thing.SelfWeight, CardBlueprint.Set(), ElementContainer.SetBase(), Rand.SetSeed(), and Card.things.

Referenced by CreateTreasure(), Trait.OnBarter(), SurvivalManager.OnMineWreck(), TraitChest.Prespawn(), TraitChestOyster.Prespawn(), and TraitCoffin.Prespawn().

◆ CreateUsuihon()

static Thing ThingGen.CreateUsuihon ( Religion  faith)
inlinestatic

Definition at line 202 of file ThingGen.cs.

203 {
204 Thing thing = Create("1084");
205 thing.c_idRefName = EClass.game.religions.Healing.id;
206 return thing;
207 }
override string id

References Create(), EClass.game, ReligionManager.Healing, ReligionHealing.id, and Game.religions.

Referenced by Createジュアさまの薄い本().

◆ TestCreate()

static Thing ThingGen.TestCreate ( )
inlinestatic

Definition at line 32 of file ThingGen.cs.

33 {
34 return _Create(SpawnList.Get("thing").Select().id);
35 }

References _Create(), SpawnList.Get(), CardRow.id, and SpawnList.Select().

Referenced by CoreDebug.UpdateInput().

◆ TryLickChest()

static void ThingGen.TryLickChest ( Thing  chest)
inlinestatic

Definition at line 431 of file ThingGen.cs.

432 {
433 foreach (Chara chara in EClass._map.charas)
434 {
435 if (!chara.HasElement(1412) || chara.Dist(chest) >= 5)
436 {
437 continue;
438 }
439 chara.Say("lick", chara, chest);
440 chest.PlaySound("offering");
441 chest.PlayEffect("mutation");
442 {
443 foreach (Thing thing in chest.things)
444 {
445 thing.TryLickEnchant(chara, msg: false);
446 }
447 break;
448 }
449 }
450 }
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6613
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6647
int Dist(Card c)
Definition: Card.cs:8172
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6351
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7291
Definition: Chara.cs:10
static Map _map
Definition: EClass.cs:19
List< Chara > charas
Definition: Map.cs:81
void TryLickEnchant(Chara c, bool msg=true, Chara tg=null, BodySlot slot=null)
Definition: Thing.cs:2059

References EClass._map, Map.charas, Card.Dist(), Card.HasElement(), Card.Say(), Card.things, and Thing.TryLickEnchant().

Referenced by Chara.TryDropBossLoot().


The documentation for this class was generated from the following file: