1
0

」 feat(Ex00): Finished ClapTrap

This commit is contained in:
2024-11-27 12:28:48 +01:00
parent 41ca750253
commit 5d12e35825
2 changed files with 3 additions and 5 deletions

View File

@ -6,13 +6,11 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/20 14:29:16 by adjoly #+# #+# */
/* Updated: 2024/11/27 11:55:35 by adjoly ### ########.fr */
/* Updated: 2024/11/27 12:11:14 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "ClapTrap.hpp"
#include <iostream>
#include <pthread.h>
#include <string>
ClapTrap::ClapTrap(void) :
@ -60,7 +58,7 @@ void ClapTrap::attack(const std::string& target) {
void ClapTrap::takeDamage(unsigned int amount) {
log("🥊", _name, "take " + iToS(amount) + " damage");
if (_health >= amount) {
if (_health <= amount) {
log("💀", _name, "is dead HAHA");
_health = 0;
} else {

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/20 14:25:07 by adjoly #+# #+# */
/* Updated: 2024/11/27 11:52:11 by adjoly ### ########.fr */
/* Updated: 2024/11/27 12:28:17 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */