Elin Decompiled Documentation EA 23.315 Nightly
Loading...
Searching...
No Matches
CustomDramaExpansion.cs File Reference

Go to the source code of this file.

Classes

class  CustomDramaExpansion
 

Functions

 publicstaticboolParsection (stringaction, ramaManagerdm, ictionary< string, string >line)
 
static bool DefaultDramaInvokeExtActionParser (DramaManager dm, Dictionary< string, string > line)
 
static bool DefaultDramaEvalActionParser (DramaManager dm, Dictionary< string, string > line)
 
static bool eval (DramaManager dm, Dictionary< string, string > line, params string[] parameters)
 
static bool and (DramaManager dm, Dictionary< string, string > line, params string[] parameters)
 
static bool or (DramaManager dm, Dictionary< string, string > line, params string[] parameters)
 
static bool not (DramaManager dm, Dictionary< string, string > line, params string[] parameters)
 
static bool console_cmd (DramaManager dm, Dictionary< string, string > line, params string[] parameters)
 
static bool add_item (DramaManager dm, Dictionary< string, string > line, string itemId, string materialAlias="wood", int lv=-1, int count=1)
 
static bool apply_condition (DramaManager dm, Dictionary< string, string > line, string conditionAlias, int power=100)
 
static bool equip_item (DramaManager dm, Dictionary< string, string > line, string itemId)
 
static bool destroy_item (DramaManager dm, Dictionary< string, string > line, string itemId, int count=-1)
 
static bool remove_condition (DramaManager dm, Dictionary< string, string > line, string conditionAlias)
 
static bool join_faith (DramaManager dm, Dictionary< string, string > line, string religionId="")
 
static bool join_party (DramaManager dm, Dictionary< string, string > line)
 
static bool if_affinity (DramaManager dm, Dictionary< string, string > line, DramaValueExpression expr)
 
static bool if_condition (DramaManager dm, Dictionary< string, string > line, string conditionAlias, DramaValueExpression expr=null)
 
static bool if_currency (DramaManager dm, Dictionary< string, string > line, string currencyId, DramaValueExpression expr)
 
static bool if_element (DramaManager dm, Dictionary< string, string > line, string elementAlias, DramaValueExpression expr)
 
static bool if_faith (DramaManager dm, Dictionary< string, string > line, string religionId, DramaValueExpression expr=null)
 
static bool if_fame (DramaManager dm, Dictionary< string, string > line, DramaValueExpression expr)
 
static bool if_flag (DramaManager dm, Dictionary< string, string > line, string flagKey, DramaValueExpression expr=null)
 
static bool if_has_item (DramaManager dm, Dictionary< string, string > line, string itemId, DramaValueExpression expr=null)
 
static bool if_hostility (DramaManager dm, Dictionary< string, string > line, string expression)
 
static bool if_in_party (DramaManager dm, Dictionary< string, string > line, bool isInParty=true)
 
 if (!match.Success)
 
static bool if_keyitem (DramaManager dm, Dictionary< string, string > line, string keyitemId, DramaValueExpression expr=null)
 
static bool if_lv (DramaManager dm, Dictionary< string, string > line, DramaValueExpression expr)
 
static bool if_race (DramaManager dm, Dictionary< string, string > line, string raceId)
 
static bool if_tag (DramaManager dm, Dictionary< string, string > line, string tag)
 
static bool if_zone (DramaManager dm, Dictionary< string, string > line, string zoneId, int zoneLv=99999)
 
static bool if_zone_2 (DramaManager dm, Dictionary< string, string > line, string zoneFullName)
 
static bool mod_affinity (DramaManager dm, Dictionary< string, string > line, DramaValueExpression expr)
 
static bool mod_currency (DramaManager dm, Dictionary< string, string > line, string currencyId, DramaValueExpression expr)
 
static bool mod_element (DramaManager dm, Dictionary< string, string > line, string elementAlias, int value=1, int potential=100)
 
static bool mod_element_exp (DramaManager dm, Dictionary< string, string > line, string elementAlias, DramaValueExpression expr)
 
static bool mod_fame (DramaManager dm, Dictionary< string, string > line, DramaValueExpression expr)
 
static bool mod_flag (DramaManager dm, Dictionary< string, string > line, string flagKey, DramaValueExpression expr=null)
 
static bool mod_keyitem (DramaManager dm, Dictionary< string, string > line, string keyitemId, DramaValueExpression expr=null)
 
static bool move_next_to (DramaManager dm, Dictionary< string, string > line, string charaId)
 
static bool move_tile (DramaManager dm, Dictionary< string, string > line, int xOffset, int yOffset)
 
static bool move_to (DramaManager dm, Dictionary< string, string > line, int x, int y)
 
static bool move_zone (DramaManager dm, Dictionary< string, string > line, string zoneId, int zoneLv=99999)
 
static bool move_zone_2 (DramaManager dm, Dictionary< string, string > line, string zoneFullName)
 
static bool play_anime (DramaManager dm, Dictionary< string, string > line, AnimeID animeId)
 
static bool play_effect (DramaManager dm, Dictionary< string, string > line, string effectId)
 
static bool play_effect_at (DramaManager dm, Dictionary< string, string > line, string effectId, int x, int y)
 
static bool play_emote (DramaManager dm, Dictionary< string, string > line, Emo emote, float duration=1f)
 
static bool play_screen_effect (DramaManager dm, Dictionary< string, string > line, string effectId)
 
static bool pop_text (DramaManager dm, Dictionary< string, string > line, string langText)
 
static bool set_portrait (DramaManager dm, Dictionary< string, string > line, string portraitId=null)
 
static bool set_portrait_override (DramaManager dm, Dictionary< string, string > line, string portraitId=null)
 
static bool set_sprite (DramaManager dm, Dictionary< string, string > line, string spriteId=null)
 
static bool show_book (DramaManager dm, Dictionary< string, string > line, string bookEntry)
 

Variables

 $
 
RegexOptions. Compiled
 

Function Documentation

◆ add_item()

static bool add_item ( DramaManager  dm,
Dictionary< string, string >  line,
string  itemId,
string  materialAlias = "wood",
int  lv = -1,
int  count = 1 
)
static

Definition at line 258 of file CustomDramaExpansion.cs.

261 {
262 dm = dm,
263 line = line
264 };
265 if (text.StartsWith("<<<"))

◆ and()

static bool and ( DramaManager  dm,
Dictionary< string, string >  line,
params string[]  parameters 
)
static

Definition at line 218 of file CustomDramaExpansion.cs.

218 {
219 object obj = DeferredCompileAndRun();
220 if (obj is string result)
221 {
222 return result;
223 }
224 return (obj is bool && !(bool)obj) ? "" : jump;
225 }

◆ apply_condition()

static bool apply_condition ( DramaManager  dm,
Dictionary< string, string >  line,
string  conditionAlias,
int  power = 100 
)
static

Definition at line 268 of file CustomDramaExpansion.cs.

270 {
271 throw new FileNotFoundException(text2);
272 }

◆ console_cmd()

static bool console_cmd ( DramaManager  dm,
Dictionary< string, string >  line,
params string[]  parameters 
)
static

Definition at line 251 of file CustomDramaExpansion.cs.

253 {
254 string text = string.Join(',', parameters);
255 if (text.IsEmpty())

◆ DefaultDramaEvalActionParser()

static bool DefaultDramaEvalActionParser ( DramaManager  dm,
Dictionary< string, string >  line 
)
staticpackage

Definition at line 115 of file CustomDramaExpansion.cs.

115 :
116 num--;
117 break;
118 case ',':
119 if (num == 0)
120 {
121 string s2 = args[num2..i].Trim();
122 s2 = Unquote(s2);
123 list.Add(s2);
124 num2 = i + 1;
125 }
126 break;
127 }
128 }
129 }
130 if (num2 < args.Length)
131 {
132 string text = args[num2..].Trim();
133 if (text.Length > 0)
134 {
135 list.Add(Unquote(text));
136 }
137 }
138 return list.ToArray();
139 }
140 static string Unquote(string s)
141 {
142 if (s.Length >= 2 && ((s[0] == '"' && s[^1] == '"') || (s[0] == '\'' && s[^1] == '\'')))
143 {
144 return s[1..^1];
145 }
146 return s;
147 }
148 }
149
150 [ElinDramaActionParser("i*")]
151 [ElinDramaActionParser("invoke*")]
152 internal static bool DefaultDramaInvokeExtActionParser(DramaManager dm, Dictionary<string, string> line)
153 {
154 string text = line["param"].Trim().RemoveNewline();
155 if (text.StartsWith("//"))
156 {
157 return true;
158 }
159 var (invoke, parameters) = BuildInvokeExpression(text);
160 if (invoke.Method == null)
161 {
162 ModUtil.LogModError("invalid drama invoke* expression '" + text + "'", new FileInfo(dm.path));
163 return true;
164 }
165 string jump = line["jump"];
166 if (!jump.IsEmpty())
167 {
168 dm.AddEvent(new DramaEventMethod(null)
169 {
170 jumpFunc = () => (!invoke.SafeInvoke(dm, line, parameters)) ? "" : jump
171 });
172 return true;
173 }
174 dm.AddEvent(new DramaEventMethod(delegate
175 {
176 invoke.SafeInvoke(dm, line, parameters);
177 }));
178 return true;
179 }
180
181 [ElinDramaActionParser("eval")]
static bool DefaultDramaInvokeExtActionParser(DramaManager dm, Dictionary< string, string > line)
DramaEvent AddEvent(DramaEvent e)

References CustomDramaExpansion.Unquote().

◆ DefaultDramaInvokeExtActionParser()

static bool DefaultDramaInvokeExtActionParser ( DramaManager  dm,
Dictionary< string, string >  line 
)
staticpackage

Definition at line 85 of file CustomDramaExpansion.cs.

85 {
86 if (args.IsEmpty())
87 {
88 return Array.Empty<string>();
89 }
90 List<string> list = new List<string>();
91 int num = 0;
92 int num2 = 0;
93 char c = '\0';
94 for (int i = 0; i < args.Length; i++)
95 {
96 char c2 = args[i];
97 if (c != 0)
98 {
99 if (c2 == c)
100 {
101 c = '\0';
102 }
103 }
104 else
105 {
106 switch (c2)
107 {
108 case '"':
109 case '\'':
110 c = c2;
111 break;
112 case '(':

◆ destroy_item()

static bool destroy_item ( DramaManager  dm,
Dictionary< string, string >  line,
string  itemId,
int  count = -1 
)
static

Definition at line 282 of file CustomDramaExpansion.cs.

286 {
287 return parameters.All(delegate(string expr)
288 {
289 var (dramaInvokeDetail, parameters2) = BuildInvokeExpression(expr);
290 return dramaInvokeDetail.SafeInvoke(dm, line, parameters2);
291 });
292 }
293
294 [MethodImpl(MethodImplOptions.AggressiveInlining)]
295 [ElinDramaActionInvoke("nodiscard")]
296 public static bool or(DramaManager dm, Dictionary<string, string> line, params string[] parameters)
297 {
298 return parameters.Any(delegate(string expr)
299 {
300 var (dramaInvokeDetail, parameters2) = BuildInvokeExpression(expr);
301 return dramaInvokeDetail.SafeInvoke(dm, line, parameters2);
302 });
303 }
304
305 [MethodImpl(MethodImplOptions.AggressiveInlining)]
306 [ElinDramaActionInvoke("nodiscard")]
307 public static bool not(DramaManager dm, Dictionary<string, string> line, params string[] parameters)
308 {
309 return parameters.All(delegate(string expr)
310 {
311 var (dramaInvokeDetail, parameters2) = BuildInvokeExpression(expr);
static bool not(DramaManager dm, Dictionary< string, string > line, params string[] parameters)
static bool or(DramaManager dm, Dictionary< string, string > line, params string[] parameters)

◆ equip_item()

static bool equip_item ( DramaManager  dm,
Dictionary< string, string >  line,
string  itemId 
)
static

Definition at line 275 of file CustomDramaExpansion.cs.

277 {
278 return (bool)obj;
279 }

◆ eval()

static bool eval ( DramaManager  dm,
Dictionary< string, string >  line,
params string[]  parameters 
)
static

Definition at line 185 of file CustomDramaExpansion.cs.

186 {
187 return true;
188 }
189 EScriptSubmission submission = EScriptSubmission.Create(dm.setup.book);
191 {
192 dm = dm,
193 line = line
194 };
195 string jump = line["jump"];
196 bool flag = !jump.IsEmpty();
197 bool flag2 = !line["id"].IsEmpty();
198 if (!flag && flag2)
199 {
200 Dictionary<string, string> item = new Dictionary<string, string>(line)
201 {
202 ["action"] = "",
203 ["param"] = ""
204 };
205 dm.ParseLine(item);
206 dm.lastTalk.activeCondition = delegate
207 {
208 object obj2 = DeferredCompileAndRun();
209 return obj2 is bool && (bool)obj2;
210 };
211 return true;
212 }
213 if (flag)
214 {
void ParseLine(Dictionary< string, string > item)
DramaSetup setup
Definition: DramaManager.cs:34
string book
Definition: DramaSetup.cs:9

◆ if()

if_in_party.if ( !match::Success  )

Definition at line 449 of file CustomDramaExpansion.cs.

450 {
451 Chara chara = dm.GetChara(line["actor"]);
452 if (chara.HasElement(elementAlias))
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6285
Definition: Chara.cs:10

References DramaManager.GetChara(), and Card.HasElement().

Referenced by HotItemNoItem._TrySetAct(), ActPlan._Update(), HoardActor.Activate(), Zone.Activate(), LayerEditPortrait.Activate(), MeshPass.AddShadow(), CoreConfig.ApplyGrading(), CoreConfig.ApplyScale(), Scene.ApplyZoneConfig(), Chara.DestroyPath(), LayerPixelPaint.DialogLoad(), WidgetManager.DialogLoad(), WidgetManager.DialogSave(), BaseTileMap.Draw(), BaseTileMap.DrawRoof(), BaseTileMap.DrawTile(), TileMapElona.DrawTile(), PartialMap.ExportDialog(), Zone.ExportDialog(), QuestSupplySpecific.GetBonus(), Check.GetDC(), HomeResourceNature.GetDestValue(), TraitTicketFurniture.GetPrice(), Los.GetRushPoint(), BaseTileMap.GetThingPosition(), EloMap.GetTileInfo(), Zone.GrowPlants(), AM_Copy.ImportDialog(), Zone.ImportDialog(), Window.Init(), InvOwner.ListInteractions(), TaskDump.ListThingsToPut(), TraitSeed.MakeSeed(), SurvivalManager.MeteorThing(), CharacterSpacing.ModifyMesh(), Widget.OnChangePosition(), ContentConfigOther.OnClickDownloadWallpaper(), WidgetSceneCustomizer.OnClickLoad(), WidgetSceneCustomizer.OnClickSave(), TraitBookSkill.OnCreate(), TaskDrawWater.OnCreateProgress(), LayerConfig.OnInit(), LayerEditHouse.OnInit(), ListPeopleCallReserve.OnInstantiate(), GenRoom.OnPopulate(), AM_Populate.OnProcessTiles(), AM_Terrain.OnProcessTiles(), TraitDeed.OnRead(), FactionBranch.OnSimulateHour(), ContentQuest.OnSwitchContent(), Scene.OnUpdate(), Chara.PerformWork(), AttackProcess.Prepare(), FoodEffect.Proc(), ActEffect.Proc(), ActEffect.ProcAt(), UIDistribution.Refresh(), LayerCraftFloat.RefreshDisassemble(), LayerHome.RefreshFeat(), ButtonHotItem.RefreshItem(), ContentPolicy.RefreshPolicyList(), BaseGameScreen.RefreshPosition(), GameScreenElona.RefreshPosition(), WindowChara.RefreshSkill(), AI_HaulResource.Run(), AI_Idle.Run(), AI_PlayMusic.Run(), WidgetSearch.Search(), UIDynamicList.Select< T >(), GridItemRecipe.SetButton(), ButtonGrid.SetCard(), UIInventory.Sort(), Card.SpawnLoot(), Fov.TraceLine(), Chara.TryPush(), HotItemAct.TrySetAct(), HotItemHeld.TrySetAct(), TraitWell.TrySetAct(), TraitCatalyst.TrySetHeldAct(), LayerInventory.TryShowGuide(), Chara.TryTakeSharedItems(), FactionBranch.UpdateReqruits(), WidgetDebug.UpdateText(), TraitBed.ValidateOwners(), ActEffect.Wish(), and Thing.WriteNote().

◆ if_affinity()

static bool if_affinity ( DramaManager  dm,
Dictionary< string, string >  line,
DramaValueExpression  expr 
)
static

Definition at line 351 of file CustomDramaExpansion.cs.

353 {
354 foreach (Thing item in list)
355 {
Definition: Thing.cs:8

References item.

◆ if_condition()

static bool if_condition ( DramaManager  dm,
Dictionary< string, string >  line,
string  conditionAlias,
DramaValueExpression  expr = null 
)
static

Definition at line 358 of file CustomDramaExpansion.cs.

360 {
361 count = Math.Max(count, 0);
362 foreach (Thing item2 in list)
363 {
364 if (count == 0)
365 {
366 break;
367 }
368 if (item2.Num >= count)
369 {
370 item2.ModNum(-count);
371 continue;
372 }
int Num
Definition: Card.cs:161
void ModNum(int a, bool notify=true)
Definition: Card.cs:3673

◆ if_currency()

static bool if_currency ( DramaManager  dm,
Dictionary< string, string >  line,
string  currencyId,
DramaValueExpression  expr 
)
static

Definition at line 375 of file CustomDramaExpansion.cs.

◆ if_element()

static bool if_element ( DramaManager  dm,
Dictionary< string, string >  line,
string  elementAlias,
DramaValueExpression  expr 
)
static

Definition at line 382 of file CustomDramaExpansion.cs.

382 {
383 foreach (Condition item in dm.GetChara(line["actor"]).conditions.ToList())
384 {
385 if (item.source.alias == conditionAlias)
386 {
387 item.Kill();
388 }
389 }
390 return true;
List< Condition > conditions
Definition: Chara.cs:215
Chara GetChara(string id)

References Chara.conditions, DramaManager.GetChara(), and item.

◆ if_faith()

static bool if_faith ( DramaManager  dm,
Dictionary< string, string >  line,
string  religionId,
DramaValueExpression  expr = null 
)
static

Definition at line 393 of file CustomDramaExpansion.cs.

395 {
396 Chara chara = dm.GetChara(line["actor"]);
397 if (religionId.IsEmpty())
398 {
400 }
401 else
402 {
403 EClass.game.religions.Find(religionId)?.JoinFaith(chara);
404 }
405 return true;
Religion faith
Definition: Chara.cs:443
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
ReligionManager religions
Definition: Game.cs:159
Religion Find(string id)
ReligionEyth Eyth
virtual void JoinFaith(Chara c, ConvertType type=ConvertType.Default)
Definition: Religion.cs:330
ConvertType
Definition: Religion.cs:8
virtual void LeaveFaith(Chara c, Religion newFaith, ConvertType type)
Definition: Religion.cs:397

References ReligionManager.Eyth, Chara.faith, ReligionManager.Find(), EClass.game, DramaManager.GetChara(), Religion.JoinFaith(), Religion.LeaveFaith(), and Game.religions.

◆ if_fame()

static bool if_fame ( DramaManager  dm,
Dictionary< string, string >  line,
DramaValueExpression  expr 
)
static

Definition at line 408 of file CustomDramaExpansion.cs.

410 {
411 Chara chara = dm.GetChara(line["actor"]);

References DramaManager.GetChara(), Chara.MakeAlly(), and EClass.Sound.

◆ if_flag()

static bool if_flag ( DramaManager  dm,
Dictionary< string, string >  line,
string  flagKey,
DramaValueExpression  expr = null 
)
static

Definition at line 414 of file CustomDramaExpansion.cs.

419 {
420 Chara chara = dm.GetChara(line["actor"]);
421 return expr.Compare(chara._affinity);
422 }
int _affinity
Definition: Chara.cs:307

◆ if_has_item()

static bool if_has_item ( DramaManager  dm,
Dictionary< string, string >  line,
string  itemId,
DramaValueExpression  expr = null 
)
static

Definition at line 425 of file CustomDramaExpansion.cs.

426 {
427 if (expr == null)
428 {
429 expr = ">=1";
430 }
431 foreach (Condition condition in dm.GetChara(line["actor"]).conditions)
432 {
433 if (condition.source.alias == conditionAlias)
SourceStat.Row source
Definition: BaseStats.cs:16

References Chara.conditions, DramaManager.GetChara(), BaseStats.source, and BaseCondition.value.

◆ if_hostility()

static bool if_hostility ( DramaManager  dm,
Dictionary< string, string >  line,
string  expression 
)
static

Definition at line 436 of file CustomDramaExpansion.cs.

443 {
444 Chara chara = dm.GetChara(line["actor"]);
445 return expr.Compare(chara.GetCurrency(currencyId));
int GetCurrency(string id="money")
Definition: Card.cs:4133

◆ if_in_party()

static bool if_in_party ( DramaManager  dm,
Dictionary< string, string >  line,
bool  isInParty = true 
)
static

Definition at line 448 of file CustomDramaExpansion.cs.

450 {
451 Chara chara = dm.GetChara(line["actor"]);

◆ if_keyitem()

static bool if_keyitem ( DramaManager  dm,
Dictionary< string, string >  line,
string  keyitemId,
DramaValueExpression  expr = null 
)
static

Definition at line 454 of file CustomDramaExpansion.cs.

461 {
462 if (expr == null)
463 {
464 expr = ">=0";
465 }

◆ if_lv()

static bool if_lv ( DramaManager  dm,
Dictionary< string, string >  line,
DramaValueExpression  expr 
)
static

Definition at line 468 of file CustomDramaExpansion.cs.

468 {
469 return expr.Compare(faith.giftRank);
470 }
471 return false;
472 }

References faith.

◆ if_race()

static bool if_race ( DramaManager  dm,
Dictionary< string, string >  line,
string  raceId 
)
static

Definition at line 475 of file CustomDramaExpansion.cs.

476 {
477 return expr.Compare(EClass.player.fame);
478 }
static Player player
Definition: EClass.cs:13
int fame
Definition: Player.cs:948

References Player.fame, and EClass.player.

◆ if_tag()

static bool if_tag ( DramaManager  dm,
Dictionary< string, string >  line,
string  tag 
)
static

Definition at line 481 of file CustomDramaExpansion.cs.

482 {
483 if (expr == null)
484 {

◆ if_zone()

static bool if_zone ( DramaManager  dm,
Dictionary< string, string >  line,
string  zoneId,
int  zoneLv = 99999 
)
static

Definition at line 487 of file CustomDramaExpansion.cs.

493 {
494 if (expr == null)
495 {
496 expr = ">=1";
497 }
498 Chara chara = dm.GetChara(line["actor"]);
499 return expr.Compare(chara.things.List((Thing t) => t.id == itemId).Count);
500 }
501
502 [ElinDramaActionInvoke("nodiscard")]
503 public static bool if_hostility(DramaManager dm, Dictionary<string, string> line, string expression)
static bool if_hostility(DramaManager dm, Dictionary< string, string > line, string expression)
string id
Definition: Card.cs:36
ThingContainer things
Definition: Card.cs:39
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)

◆ if_zone_2()

static bool if_zone_2 ( DramaManager  dm,
Dictionary< string, string >  line,
string  zoneFullName 
)
static

Definition at line 506 of file CustomDramaExpansion.cs.

508 {
509 throw new ArgumentException("invalid expression " + expression);
510 }
511 string value = match.Groups["op"].Value;

◆ join_faith()

static bool join_faith ( DramaManager  dm,
Dictionary< string, string >  line,
string  religionId = "" 
)
static

Definition at line 327 of file CustomDramaExpansion.cs.

336 {
337 dm.GetChara(line["actor"]).AddCondition(conditionAlias, power, force: true);
338 return true;
339 }
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9642

◆ join_party()

static bool join_party ( DramaManager  dm,
Dictionary< string, string >  line 
)
static

Definition at line 342 of file CustomDramaExpansion.cs.

343 {
344 dm.GetChara(line["actor"]).body.Equip(ThingGen.Create(itemId));
345 return true;
346 }
347
348 [ElinDramaActionInvoke(null)]
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:194
CharaBody body
Definition: Chara.cs:94
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53

References Chara.body, ThingGen.Create(), CharaBody.Equip(), and DramaManager.GetChara().

◆ mod_affinity()

static bool mod_affinity ( DramaManager  dm,
Dictionary< string, string >  line,
DramaValueExpression  expr 
)
static

Definition at line 514 of file CustomDramaExpansion.cs.

516 {value}{result:D}").Compare(chara._cints[4]);
517 }
518
519 [ElinDramaActionInvoke("nodiscard")]

◆ mod_currency()

static bool mod_currency ( DramaManager  dm,
Dictionary< string, string >  line,
string  currencyId,
DramaValueExpression  expr 
)
static

Definition at line 522 of file CustomDramaExpansion.cs.

527 {
528 if (expr == null)

◆ mod_element()

static bool mod_element ( DramaManager  dm,
Dictionary< string, string >  line,
string  elementAlias,
int  value = 1,
int  potential = 100 
)
static

Definition at line 531 of file CustomDramaExpansion.cs.

533 {
534 return expr.Compare(value2);
535 }
536 return false;
537 }
538
539 [ElinDramaActionInvoke("nodiscard")]
540 public static bool if_lv(DramaManager dm, Dictionary<string, string> line, DramaValueExpression expr)
541 {
542 Chara chara = dm.GetChara(line["actor"]);
543 return expr.Compare(chara.LV);
544 }
545
546 [ElinDramaActionInvoke("nodiscard")]
547 public static bool if_race(DramaManager dm, Dictionary<string, string> line, string raceId)
static bool if_lv(DramaManager dm, Dictionary< string, string > line, DramaValueExpression expr)
static bool if_race(DramaManager dm, Dictionary< string, string > line, string raceId)
int LV
Definition: Card.cs:389

◆ mod_element_exp()

static bool mod_element_exp ( DramaManager  dm,
Dictionary< string, string >  line,
string  elementAlias,
DramaValueExpression  expr 
)
static

Definition at line 550 of file CustomDramaExpansion.cs.

554 {
555 return dm.GetChara(line["actor"]).source.tag.Contains(tag);
556 }
557
558 [ElinDramaActionInvoke("nodiscard")]
559 public static bool if_zone(DramaManager dm, Dictionary<string, string> line, string zoneId, int zoneLv = 99999)
560 {
static bool if_zone(DramaManager dm, Dictionary< string, string > line, string zoneId, int zoneLv=99999)
SourceChara.Row source
Definition: Chara.cs:162

◆ mod_fame()

static bool mod_fame ( DramaManager  dm,
Dictionary< string, string >  line,
DramaValueExpression  expr 
)
static

Definition at line 563 of file CustomDramaExpansion.cs.

563 {
564 return false;
565 }
566 if (currentZone.id == zoneId)
567 {

◆ mod_flag()

static bool mod_flag ( DramaManager  dm,
Dictionary< string, string >  line,
string  flagKey,
DramaValueExpression  expr = null 
)
static

Definition at line 570 of file CustomDramaExpansion.cs.

579 {

◆ mod_keyitem()

static bool mod_keyitem ( DramaManager  dm,
Dictionary< string, string >  line,
string  keyitemId,
DramaValueExpression  expr = null 
)
static

Definition at line 582 of file CustomDramaExpansion.cs.

587 {
588 Chara chara = dm.GetChara(line["actor"]);
589 chara.ModAffinity(EClass.pc, expr.Diff(chara._affinity));
590 return true;
591 }
592
593 [ElinDramaActionInvoke(null)]
594 public static bool mod_currency(DramaManager dm, Dictionary<string, string> line, string currencyId, DramaValueExpression expr)
595 {
596 Chara chara = dm.GetChara(line["actor"]);
597 int currency = chara.GetCurrency(currencyId);
598 chara.ModCurrency(expr.Diff(currency), currencyId);
599 return true;
600 }
601
602 [ElinDramaActionInvoke(null)]
603 public static bool mod_element(DramaManager dm, Dictionary<string, string> line, string elementAlias, int value = 1, int potential = 100)
604 {
605 Chara chara = dm.GetChara(line["actor"]);
606 Element orCreateElement = chara.elements.GetOrCreateElement(elementAlias);
607 if (orCreateElement != null)
608 {
@ currency
static bool mod_currency(DramaManager dm, Dictionary< string, string > line, string currencyId, DramaValueExpression expr)
static bool mod_element(DramaManager dm, Dictionary< string, string > line, string elementAlias, int value=1, int potential=100)
ElementContainerCard elements
Definition: Card.cs:42
void ModCurrency(int a, string id="money")
Definition: Card.cs:4119
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8236
static Chara pc
Definition: EClass.cs:15
Element GetOrCreateElement(Element ele)

◆ move_next_to()

static bool move_next_to ( DramaManager  dm,
Dictionary< string, string >  line,
string  charaId 
)
static

Definition at line 611 of file CustomDramaExpansion.cs.

611 : true);
612 }
613 else
614 {
615 chara.elements.SetBase(orCreateElement.id, value, potential);
616 }
617 }
618 return true;
619 }
620
621 [ElinDramaActionInvoke(null)]
622 public static bool mod_element_exp(DramaManager dm, Dictionary<string, string> line, string elementAlias, DramaValueExpression expr)
static bool mod_element_exp(DramaManager dm, Dictionary< string, string > line, string elementAlias, DramaValueExpression expr)

◆ move_tile()

static bool move_tile ( DramaManager  dm,
Dictionary< string, string >  line,
int  xOffset,
int  yOffset 
)
static

Definition at line 625 of file CustomDramaExpansion.cs.

627 {
628 return true;
629 }
630 chara.ModExp(orCreateElement.id, expr.Diff(orCreateElement.vExp));
631 return true;

◆ move_to()

static bool move_to ( DramaManager  dm,
Dictionary< string, string >  line,
int  x,
int  y 
)
static

Definition at line 634 of file CustomDramaExpansion.cs.

636 {
638 return true;
639 }
640
void ModFame(int a)
Definition: Player.cs:2166

References Player.fame, Player.ModFame(), and EClass.player.

◆ move_zone()

static bool move_zone ( DramaManager  dm,
Dictionary< string, string >  line,
string  zoneId,
int  zoneLv = 99999 
)
static

Definition at line 643 of file CustomDramaExpansion.cs.

643 {
644 if (expr == null)
645 {
646 expr = "=1";
647 }
648 Chara chara = dm.GetChara(line["actor"]);
649 chara.SetInt(flagKey, expr.ModOrSet(chara.GetInt(flagKey)));
650 return true;
651 }
652
653 [ElinDramaActionInvoke("nodiscard")]
654 public static bool mod_keyitem(DramaManager dm, Dictionary<string, string> line, string keyitemId, DramaValueExpression expr = null)
655 {
656 if (!EClass.sources.keyItems.alias.TryGetValue(keyitemId, out var value))
657 {
658 return false;
659 }
660 if (expr == null)
static bool mod_keyitem(DramaManager dm, Dictionary< string, string > line, string keyitemId, DramaValueExpression expr=null)
void SetInt(string id, int value=0)
Definition: Card.cs:2570
int GetInt(string id, int? defaultInt=null)
Definition: Card.cs:2551
static SourceManager sources
Definition: EClass.cs:43
SourceKeyItem keyItems

References DramaManager.GetChara(), Card.GetInt(), and Card.SetInt().

◆ move_zone_2()

static bool move_zone_2 ( DramaManager  dm,
Dictionary< string, string >  line,
string  zoneFullName 
)
static

Definition at line 663 of file CustomDramaExpansion.cs.

669 {
670 SE.Play("keyitem");
671 Msg.Say("get_keyItem", value.GetName());
672 }
673 else if (num > num2)
674 {
675 SE.Play("keyitem_lose");
676 Msg.Say("lose_keyItem", value.GetName());
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58

◆ not()

static bool not ( DramaManager  dm,
Dictionary< string, string >  line,
params string[]  parameters 
)
static

Definition at line 240 of file CustomDramaExpansion.cs.

241 {
242 throw new FileNotFoundException(text);
243 }
244 expr = File.ReadAllText(path);
245 }
246 return submission.Compile<EDramaScriptState>(expr)?.Invoke(state);
247 }

Referenced by DramaCustomSequence.Build(), Quest.Create(), Card.DamageHP(), Map.MineObj(), TaskBuild.OnProgressComplete(), and AI_Shopping.TryRestock().

◆ or()

static bool or ( DramaManager  dm,
Dictionary< string, string >  line,
params string[]  parameters 
)
static

Definition at line 229 of file CustomDramaExpansion.cs.

230 {
231 DeferredCompileAndRun();
232 }));
233 return true;
234 object DeferredCompileAndRun()
235 {
236 if (expr.StartsWith("<<<"))

◆ play_anime()

static bool play_anime ( DramaManager  dm,
Dictionary< string, string >  line,
AnimeID  animeId 
)
static

Definition at line 679 of file CustomDramaExpansion.cs.

◆ play_effect()

static bool play_effect ( DramaManager  dm,
Dictionary< string, string >  line,
string  effectId 
)
static

Definition at line 686 of file CustomDramaExpansion.cs.

688 {
689 return false;
690 }

◆ play_effect_at()

static bool play_effect_at ( DramaManager  dm,
Dictionary< string, string >  line,
string  effectId,
int  x,
int  y 
)
static

Definition at line 693 of file CustomDramaExpansion.cs.

◆ play_emote()

static bool play_emote ( DramaManager  dm,
Dictionary< string, string >  line,
Emo  emote,
float  duration = 1f 
)
static

Definition at line 700 of file CustomDramaExpansion.cs.

701 : false);
702 return true;
703 }
704

◆ play_screen_effect()

static bool play_screen_effect ( DramaManager  dm,
Dictionary< string, string >  line,
string  effectId 
)
static

Definition at line 707 of file CustomDramaExpansion.cs.

707 {
708 Chara chara = dm.GetChara(line["actor"]);
709 Point newPoint = new Point(x, y);
710 chara.TryMove(newPoint, allowDestroyPath: false);
711 return true;
override MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2814
Definition: Point.cs:9

References DramaManager.GetChara(), and Chara.TryMove().

◆ pop_text()

static bool pop_text ( DramaManager  dm,
Dictionary< string, string >  line,
string  langText 
)
static

Definition at line 714 of file CustomDramaExpansion.cs.

716 {
717 Chara chara = dm.GetChara(line["actor"]);
718 if (zoneLv == 99999)

References DramaManager.GetChara().

◆ publicstaticboolParsection()

_expressionRegex.publicstaticboolParsection ( stringaction  ,
ramaManagerdm  ,
ictionary< string, string >  line 
)

Definition at line 18 of file CustomDramaExpansion.cs.

References CustomDramaExpansion._actionParsers.

◆ remove_condition()

static bool remove_condition ( DramaManager  dm,
Dictionary< string, string >  line,
string  conditionAlias 
)
static

Definition at line 314 of file CustomDramaExpansion.cs.

319 {
320 string.Join(' ', parameters).EvaluateAsCommand();
321 return true;
322 }
323
324 [ElinDramaActionInvoke(null)]

◆ set_portrait()

static bool set_portrait ( DramaManager  dm,
Dictionary< string, string >  line,
string  portraitId = null 
)
static

Definition at line 721 of file CustomDramaExpansion.cs.

722 {zoneId}@{zoneLv}");
723 if (zone == null)
724 {
725 return false;
726 }
727 chara.MoveZone(zone, new ZoneTransition
728 {
729 state = ZoneTransition.EnterState.RandomVisit
730 });
731 return true;
732 }
733
734 [ElinDramaActionInvoke("nodiscard")]
735 public static bool move_zone_2(DramaManager dm, Dictionary<string, string> line, string zoneFullName)
736 {
737 Chara chara = dm.GetChara(line["actor"]);
738 Zone zone = ModUtil.FindZoneByFullName(zoneFullName);
739 if (zone == null)
740 {
741 return false;
742 }
743 chara.MoveZone(zone, new ZoneTransition
744 {

◆ set_portrait_override()

static bool set_portrait_override ( DramaManager  dm,
Dictionary< string, string >  line,
string  portraitId = null 
)
static

Definition at line 747 of file CustomDramaExpansion.cs.

◆ set_sprite()

static bool set_sprite ( DramaManager  dm,
Dictionary< string, string >  line,
string  spriteId = null 
)
static

Definition at line 754 of file CustomDramaExpansion.cs.

◆ show_book()

static bool show_book ( DramaManager  dm,
Dictionary< string, string >  line,
string  bookEntry 
)
static

Definition at line 761 of file CustomDramaExpansion.cs.

766 {
767 Effect.Get(effectId)?.Play(new Point(x, y));
768 return true;
769 }
770
771 [ElinDramaActionInvoke(null)]
772 public static bool play_emote(DramaManager dm, Dictionary<string, string> line, Emo emote, float duration = 1f)
773 {
774 dm.GetChara(line["actor"]).ShowEmo(emote, duration, skipSame: false);
775 return true;
776 }
777
778 [ElinDramaActionInvoke(null)]
779 public static bool play_screen_effect(DramaManager dm, Dictionary<string, string> line, string effectId)
780 {
781 ScreenEffect.Play(effectId);
static bool play_emote(DramaManager dm, Dictionary< string, string > line, Emo emote, float duration=1f)
static bool play_screen_effect(DramaManager dm, Dictionary< string, string > line, string effectId)
Emo
Definition: Emo.cs:2
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:6511
Definition: Effect.cs:7
static Effect Get(Effect original)
Definition: Effect.cs:80
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
static void Play(string id)
Definition: ScreenEffect.cs:17

Variable Documentation

◆ $

◆ Compiled

RegexOptions. Compiled

Definition at line 16 of file CustomDramaExpansion.cs.