「✨」 feat(Ex00): Finished ClapTrap
This commit is contained in:
@ -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 {
|
||||
|
@ -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 */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
Reference in New Issue
Block a user