Le dernier coup donnant de l'expérience en attaque ou en défense lors d'un combat apparaitrait en rouge.
C'est absolument inutile, donc totalement indispensable

PS : en réalité ça servirait pour visualiser quand fuir un combat pour l'entrainement.
Code : Tout sélectionner
Index: stats.c
===================================================================
--- stats.c (révision 2343)
+++ stats.c (copie de travail)
@@ -68,6 +68,11 @@
int have_stats=0;
+#ifndef ENGLISH
+int counter_xp_def=0;
+int counter_xp_att=0;
+#endif
+
#define MAX_NUMBER_OF_FLOATING_MESSAGES 25
typedef struct {
@@ -1288,7 +1293,6 @@
void floatingmessages_add_level(int actor_id, int level, const unsigned char * skillname)
{
char str[50];
-
safe_snprintf(str,sizeof(str),"%d %s",level, skillname);
add_floating_message(actor_id, str, FLOATINGMESSAGE_NORTH, 0.3, 0.3, 1.0, 2000);
}
@@ -1299,9 +1303,28 @@
int diff=new_value-value;
safe_snprintf(str, sizeof(str), "%s: %c%d", skillname, diff<0?' ':'+', diff);
-
if(diff<0)
add_floating_message(actor_id, str, FLOATINGMESSAGE_SOUTH, 1.0, 0.3, 0.3,1500);
else
+#ifdef ENGLISH
add_floating_message(actor_id, str, FLOATINGMESSAGE_NORTH, 0.3, 1.0, 0.3,1500);
+#else
+ //@tosh : On color en rouge si on arrive en fin d'xp défense
+ {
+ float r=0.3, g=1.0, b=0.3;
+ if(!strcmp((char*)skillname, (char*)attributes.defense_skill.shortname))
+ {
+ if(counter_xp_def >=14)
+ r=1.0, g=0.0, b=0.0;
+ counter_xp_def++;
+ }
+ else if(!strcmp((char*)skillname, (char*)attributes.attack_skill.shortname))
+ {
+ if(counter_xp_att >= 14)
+ r=1.0, g=0.0, b=0.0;
+ counter_xp_att++;
+ }
+ add_floating_message(actor_id, str, FLOATINGMESSAGE_NORTH, r, g, b, 1500);
+ }
+#endif
}
Index: stats.h
===================================================================
--- stats.h (révision 2343)
+++ stats.h (copie de travail)
@@ -279,6 +279,11 @@
extern player_attribs your_info; /*!< the players attributes */
+#ifndef ENGLISH
+extern int counter_xp_def; //@tosh : Compteurs de coups pour la défense
+extern int counter_xp_att; //@tosh : Compteurs de coups pour l'attaque
+#endif
+
/*!
* \ingroup stats_window
* \brief Retrieves the statistics of the player.
Index: actor_scripts.c
===================================================================
--- actor_scripts.c (révision 2343)
+++ actor_scripts.c (copie de travail)
@@ -998,6 +998,13 @@
cal_actor_set_anim(i,actors_defs[actor_type].cal_frames[cal_actor_out_combat_frame]);
actors_list[i]->stop_animation=1;
actors_list[i]->fighting=0;
+#ifndef ENGLISH
+ if(actors_list[i]->actor_id == yourself)
+ {
+ counter_xp_def=0;
+ counter_xp_att=0;
+ }
+#endif
break;
case attack_up_1:
case attack_up_2: