So you want Crates to be non-LOS-Blocking?
I can probably help here.
I have ghosts in my game that needed to be counted as "See-through" for the purpose of being able to actually use a magical attack through them.
In LeTBS.js
there is this function
TBSCell.prototype.isObstacleForLOS = function () {
if (this.regionId() === Lecode.S_TBS.obstacleRegionId) return true;
if (this.isThereEntity()) {
var entity = this.getEntity();
if (entity.isPassable()) return false;
return true;
}
var tbsEvent = this.getEvent();
if (tbsEvent && tbsEvent.isObstacleForLOS()) return true;
return false;
};
So by this logic, if the entity is NOT passable, it blocks LOS.
I modified my function however,
TBSCell.prototype.isObstacleForLOS = function () {
if (this.regionId() === Lecode.S_TBS.obstacleRegionId) return true;
if (this.isThereEntity()) {
var entity = this.getEntity();
if (
entity.isPassable() || entity._battler.hasLeTBSTag("see_thru")) return false;
return true;
}
var tbsEvent = this.getEvent();
if (tbsEvent && tbsEvent.isObstacleForLOS()) return true;
return false;
};
This means if the entity has the <passable> tag or my new <see_thru> tag, it returns false- it does not block LOS
I also added a tag to "processLeTBSTagsForBattlers"
under the line where it checks for passable, i added one for see_thru
else if (line.match(/passable/i))
obj.TagsLetbs.passable = true;
else if (line.match(/see_thru/i))
obj.TagsLetbs.see_thru = true;
I do not guarantee that this will work for you, nor do I recommend editing the JS file if you are not confident in your ability
I got cover working from an aura, however, it applies regardless, so if you set it to NSE&W, if anyone is in those 4 positions, it protects them regardless.
I used Yanfly's cover mechanic however to make a "Cover" skill that allows the user of cover (only the paladin in my game) to draw the fatal damage to themselves.
Basically This is linked to an aura (set up in letbs_config.js
"aura_sacrifice": {
size: "circle(1)",
affect_caster: false,
target_type: "ally",
states: [331],
},
Covers the area of a 1 size circle, and any ally in that circle is granted the "Guardian Angel" State.
So if this ally would take fatal damage, it redirects the the Lanna/Landon character in my game.
I am able to do this, because the aura originates from L.
Apply State: Cover To an ally you want the cover aura to belong to, use these notetags:
This will surround the user with an aura that applies the "If i take damage, redirect it" thingo.
<letbs>
auras: aura_sacrifice
</letbs>
Put this in the state belonging to the aura
<Custom React Effect>
// Check if this action deals HP damage greater than current hp
if (this.isHpEffect() && value > target.hp)
{
var redirect = value;
value = 0;
var member;
for (var i = 0, len = $gameParty.battleMembers().length; i < len; i++)
{
member = $gameParty.battleMembers()
if(member._name=="Lanna" || member._name=="Landon")
{
break;
}
}
if(member._name=="Lanna"|| member._name=="Landon")
{
console.log("Landon/Lanna Found"
}
if (member.isDead())
{
value=redirect; redirect=0;
}
else
{
// Make Landon/Lanna take damage
member.gainHp(-redirect);
member.startDamagePopup();
member.startAnimation(2);
if (member.isDead()) {member.performCollapse();}
}
}
</Custom React Effect>
BIG EDIT:
Realized I accidentally put see-thu instead of see_thru
EDIT 2: fixed broken code
changed entity.hasLeTBSTag to entity._battler.hasLeTBSTag