Gustavo_Antonio123
Terrarian
I did not ask your opinion
Not an opinion, but a fact. If you continue to ignore the rules and staff direction, you may lose some of your privileges to post.I did not ask your opinion
public override void UpdateInventory(Player player)
{
if (player.inventory[player.selectedItem] == this.item){
if (player.statLifeMax <= player.statLifeMax2/2){
player.meleeDamage /= 2f;
((RequiemPlayer)player.GetModPlayer(mod, "RequiemPlayer")).critMultiplier = 1.25f;//<- An additional 50% critical hit damage.
}
else {
player.meleeDamage *= 1.252f;
((RequiemPlayer)player.GetModPlayer(mod, "RequiemPlayer")).critMultiplier = 1.25f;
}
}
Looks like a typo to me. Where you haveHas there been a thread for this???: I want to make a condition where the weapon will have increased damage so long as it's hp is above 50% but somehow the condition when it gets below 50% doesn't work.
Here's the code:
Code:public override void UpdateInventory(Player player) { if (player.inventory[player.selectedItem] == this.item){ if (player.statLifeMax <= player.statLifeMax2/2){ player.meleeDamage /= 2f; ((RequiemPlayer)player.GetModPlayer(mod, "RequiemPlayer")).critMultiplier = 1.25f;//<- An additional 50% critical hit damage. } else { player.meleeDamage *= 1.252f; ((RequiemPlayer)player.GetModPlayer(mod, "RequiemPlayer")).critMultiplier = 1.25f; } }
Looks like a typo to me. Where you have
if (player.statLifeMax <= player.statLifeMax2/2){
you should have
if (player.statLife <= player.statLifeMax2/2){
i don't see the problem in that photo
You're good dude, 's perfectly legitThe Tmodloader v0.11.6.1 is why not download it on the original page?
And Why this page is instead open up: tModLoader/tModLoader
Sooo This is safe and and good and all happiness?
Edit: Just to make sure Im don't get some bad stuff, not that I don't have trust in it tho...
You can get the most up to date version off the tModLoader Discord server in the #announcements channel, but apparently it may still have some bugs which is why they haven't updated the main page just yet.Wonder where the updated version of this is?
It's not on the front page, so if I can't download to update I can't play Terraria modded due to outdated mods that requires the update.
So I figured out how to add a debuff to a projectile, but now I've run into a different issue. I'm wanting to, instead of a debuff, heal the player for a third of the damage. But I don't know how to heal the player with a projectile. I've figured out that I want "ModPlayer", but I don't know what the current health property is. The healing code as it is will follow.Ok, so. I want to make a projectile with an effect, which I thought would be a fairly common thing. But I haven't been able to find anything. At all. There's nothing on how to make projectiles that give buffs or debuffs. At least, not that I can see. So, anyone got a solution? Just a quick warning, I'm not all that good with C#
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
int lifeSteal = damage / 3;
ModPlayer.statLife += lifeSteal;
ModPlayer.HealEffect(lifeSteal);
}
So I figured out how to add a debuff to a projectile, but now I've run into a different issue. I'm wanting to, instead of a debuff, heal the player for a third of the damage. But I don't know how to heal the player with a projectile. I've figured out that I want "ModPlayer", but I don't know what the current health property is. The healing code as it is will follow.
Any advice?Code:public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { int lifeSteal = damage / 3; ModPlayer.statLife += lifeSteal; ModPlayer.HealEffect(lifeSteal); }