Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .idea/.gitignore
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not open core code repository with any IDE. This repository is supposed to be submodule of other repository. For example, you just open BCU PC project, git clone this repository, and put it under "[BCU PC Project Folder]/src/main/java/" and rename clone folder to "common". Please remove all of these IDEA project folders and files

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 39 additions & 2 deletions battle/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -955,14 +955,18 @@ private void add(POISON ws) {
if (ws.type.unstackable)
list.removeIf(e -> e.type.unstackable && type(e) == type(ws));
ws.prob = 0; // used as counter

list.add(ws);
getMax();
}

private void damage(int dmg, int type) {
type &= 3;
long mul = type == 0 ? 100 : type == 1 ? e.maxH : type == 2 ? e.health : (e.maxH - e.health);

e.damage += mul * dmg / 100;


Comment on lines +968 to +969
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unnecessary linebreaks

}

private void getMax() {
Expand Down Expand Up @@ -1125,7 +1129,24 @@ private void doRevive(int c) {
deadAnim += ea.getEAnim(ZombieEff.REVIVE).len();
e.status[P_REVIVE][1] = deadAnim;
int maxR = maxRevHealth();
e.health = e.maxH * maxR / 100;

// set how much health to revive with
long reviveHealth = e.maxH * maxR / 100;

// if revive health exceeds max health, update the max health
if (reviveHealth > e.maxH)
{
e.maxH = reviveHealth;
e.health = e.maxH;
}

// otherwise set health as normal
else
{
e.health = reviveHealth;
}


Comment on lines +1132 to +1149
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this idea would be good, but please don't touch maximum HP as it will ruin interaction between healing. Touching maxH means this entity's max HP is changed forever until it dies. This would be interpreted as just dirty patch to solve problem of entity not being able to have extra HP than it can have due to limitation of maxH. You will have to use other approach than this one

if (c == 1)
e.status[P_REVIVE][0]--;
else if (c == 2)
Expand Down Expand Up @@ -1438,6 +1459,12 @@ public void update() {
*/
private boolean killCounted = false;


/**
* Damage to use for poison
*/
private int poisonDamage = 0;

/**
* cooldown timer for regeneration ability
*/
Expand All @@ -1455,6 +1482,12 @@ protected Entity(StageBasis b, MaskEntity de, EAnimU ea, float atkMagnif, float
maxCurrentShield = currentShield = (int) (de.getProc().DEMONSHIELD.hp * hpMagnif);
shieldMagnification = hpMagnif;
regentimer = getProc().HPREGEN.interval;

// scale poison damage with mag if option is enabled, otherwise keep poison damage to set value
poisonDamage = de.getProc().POISON.damage;
if (de.getProc().POISON.type.scaleWithBuff) {
poisonDamage = (int) (((float) poisonDamage) * atkMagnif);
}
}

protected Entity(StageBasis b, MaskEntity de, EAnimU ea, float lvMagnif, float tAtk, float tHP, PCoin pc, Level lv) {
Expand All @@ -1478,6 +1511,7 @@ protected Entity(StageBasis b, MaskEntity de, EAnimU ea, float lvMagnif, float t
status[P_REVIVE][0] = getProc().REVIVE.count;
status[P_DMGCUT][0] = getProc().DMGCUT.type.magnif ? (int) (lvMagnif * getProc().DMGCUT.dmg) : getProc().DMGCUT.dmg;
status[P_DMGCAP][0] = getProc().DMGCAP.type.magnif ? (int) (lvMagnif * getProc().DMGCAP.dmg) : getProc().DMGCAP.dmg;

presetStatus(lvMagnif);
presetSealedProcs();
maxCurrentShield = currentShield = (int) (de.getProc().DEMONSHIELD.hp * lvMagnif);
Expand Down Expand Up @@ -1825,6 +1859,7 @@ private void processProcs(AttackAb atk) {
if (!(ctargetable(atk.trait, atk.attacker, false) || (receive(-1) && atk.SPtr) || (receive(1) && !atk.SPtr)))
return;


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary linebreak

boolean cannonResist = atk.canon > 0 && getProc().IMUCANNON.exists() && (atk.canon & getProc().IMUCANNON.type) > 0;
if (atk.getProc().POIATK.mult > 0) {
int rst = getProc().IMUPOIATK.mult;
Expand Down Expand Up @@ -1992,8 +2027,10 @@ private void processProcs(AttackAb atk) {

ws.time = ws.time * (100 - res) / 100;

ws.damage = atk.attacker.poisonDamage;

if (atk.atk != 0 && ws.type.modifAffected)
ws.damage = (int) (ws.damage * (float) getDamage(atk, atk.atk) / atk.atk);
ws.damage = (int) (atk.attacker.poisonDamage * (float) getDamage(atk, atk.atk) / atk.atk);

pois.add(ws);
anim.getEff(P_POISON);
Expand Down
11 changes: 11 additions & 0 deletions common.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" packagePrefix="common" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
2 changes: 2 additions & 0 deletions util/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ public static class TYPE extends IntType {
public boolean ignoreMetal;
@Order(3)
public boolean modifAffected;
@Order(4)
public boolean scaleWithBuff;
}

@Order(0)
Expand Down
5 changes: 4 additions & 1 deletion util/lang/Editors.java
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,9 @@ else if (t.mult == 0)
t.type.range_type = 0;
t.type.revive_non_zombie = false;
} else {
t.health = MathUtil.clip(t.health, 1, 100);
// min revive health should be 1% with no upper cap
t.health = Math.max(1, t.health);

t.time = Math.max(t.time, 1);
if (!t.type.revive_others) {
t.dis_0 = t.dis_1 = 0;
Expand Down Expand Up @@ -494,6 +496,7 @@ else if (t.mult == 0)
t.type.unstackable = false;
t.type.ignoreMetal = false;
t.type.modifAffected = false;
t.type.scaleWithBuff = false;
} else {
t.time = Math.max(1, t.time);
t.itv = Math.max(1, t.itv);
Expand Down
4 changes: 4 additions & 0 deletions util/lang/assets/proc.json
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,10 @@
"type.modifAffected": {
"name": "Consider Abilities",
"tooltip": "Toggle this to make poison damage affected by damage-modifying abilities such as strong against or critical."
},
"type.scaleWithBuff": {
"name": "Scale With Buff",
"tooltip": "Toggle this to make the damage increase with magnifications. Works best with burn."
}
}
},
Expand Down