Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ConMiasma.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5public class ConMiasma : TimeDebuff
6{
7 public override bool IsElemental => true;
8
9 public override void Tick()
10 {
11 Dice dice = Dice.Create("miasma_", base.power);
12 try
13 {
14 owner.DamageHP(dice.Roll(), base.refVal, EClass.rnd(base.power / 2) + base.power / 4, AttackSource.Condition);
15 if (owner.IsAliveInCurrentZone && base.value > 1)
16 {
17 for (int i = 0; i < 6; i++)
18 {
19 foreach (Chara chara in owner.pos.GetRandomPoint(2).Charas)
20 {
21 if ((!owner.IsPCFaction || chara.IsPCFaction) && (owner.IsPCFaction || !chara.IsPCFaction) && chara.IsFriendOrAbove(owner) && !chara.HasCondition<ConMiasma>())
22 {
23 Condition condition = chara.AddCondition(Condition.Create(base.power / 2, delegate(ConMiasma con)
24 {
25 con.givenByPcParty = base.givenByPcParty;
26 con.SetElement(base.refVal);
27 }));
28 if (condition != null)
29 {
30 condition.value = base.value - 1;
31 }
32 if (EClass.rnd(2) == 0)
33 {
34 break;
35 }
36 }
37 }
38 }
39 }
40 }
41 catch (Exception ex)
42 {
43 Debug.Log(ex.Message);
44 Debug.Log(owner);
45 Debug.Log(base.refVal);
46 }
47 Mod(-1);
48 }
49
50 public override void OnWriteNote(List<string> list)
51 {
52 Dice dice = Dice.Create("miasma_", base.power);
53 list.Add("hintDOT".lang(dice.ToString(), base.sourceElement.GetName().ToLower()));
54 }
55}
AttackSource
Definition: AttackSource.cs:2
void SetElement(int id)
void Mod(int a, bool force=false)
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:3735
Point pos
Definition: Card.cs:55
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:546
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:8415
bool HasCondition(string alias)
Definition: Chara.cs:8568
override bool IsPCFaction
Definition: Chara.cs:656
bool IsFriendOrAbove()
Definition: Chara.cs:5972
override void Tick()
Definition: ConMiasma.cs:9
override void OnWriteNote(List< string > list)
Definition: ConMiasma.cs:50
override bool IsElemental
Definition: ConMiasma.cs:7
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
Definition: Dice.cs:4
static int Roll(int num, int sides, int bonus=0, Card card=null)
Definition: Dice.cs:15
override string ToString()
Definition: Dice.cs:91
static Dice Create(Element ele, Card c)
Definition: Dice.cs:96
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:50
List< Chara > Charas
Definition: Point.cs:316
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:741