Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
I
idle rpg irc
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Déploiement
Releases
Registre de conteneurs
Registre de modèles
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
ElTata
idle rpg irc
Validations
c7262892
Valider
c7262892
rédigé
Il y a 5 ans
par
ElTata
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
exponential distribution to choose player for events
parent
4a065351
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
CHANGELOG.md
+4
-0
4 ajouts, 0 suppression
CHANGELOG.md
Irpg/Event.pm
+32
-7
32 ajouts, 7 suppressions
Irpg/Event.pm
avec
36 ajouts
et
7 suppressions
CHANGELOG.md
+
4
−
0
Voir le fichier @
c7262892
...
@@ -12,6 +12,9 @@ before it.
...
@@ -12,6 +12,9 @@ before it.
Thanks for your interest in the Idle RPG! Feel free to contact me with ideas and
Thanks for your interest in the Idle RPG! Feel free to contact me with ideas and
comments, or post them in the issues of the project for public view.
comments, or post them in the issues of the project for public view.
---
## v5.3.0:
-
players are chosen based on exponential distribution (of their levels) for the random events
---
---
## v5.2.2: released 12/02/19
## v5.2.2: released 12/02/19
...
@@ -20,6 +23,7 @@ comments, or post them in the issues of the project for public view.
...
@@ -20,6 +23,7 @@ comments, or post them in the issues of the project for public view.
-
new command ACTIONS, do all available actions
-
new command ACTIONS, do all available actions
-
actions messages now colorize the status of the action, and the changed TTL
-
actions messages now colorize the status of the action, and the changed TTL
-
fixed chclass for classes with ' ' in their name
-
fixed chclass for classes with ' ' in their name
-
no more warnings "argument isn't numeric" in steal_result subroutine
---
---
## v5.2.1: released 10/28/19
## v5.2.1: released 10/28/19
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Irpg/Event.pm
+
32
−
7
Voir le fichier @
c7262892
...
@@ -139,8 +139,9 @@ sub find_item { # find item for argument player
...
@@ -139,8 +139,9 @@ sub find_item { # find item for argument player
sub
hog
{
# summon the hand of god
sub
hog
{
# summon the hand of god
my
@players
=
grep
{
$rps
->
{
$_
}{
online
}
}
keys
(
%$rps
);
#my @players = grep { $rps->{$_}{online} } keys(%$rps);
my
$player
=
$players
[
rand
(
@players
)];
#my $player = $players[rand(@players)];
my
$player
=
choose_player
()
||
return
;
my
$win
=
int
(
rand
(
5
));
my
$win
=
int
(
rand
(
5
));
my
$time
=
int
(((
5
+
int
(
rand
(
71
)))
/
100
)
*
$rps
->
{
$player
}{
next
});
my
$time
=
int
(((
5
+
int
(
rand
(
71
)))
/
100
)
*
$rps
->
{
$player
}{
next
});
if
(
$win
)
{
if
(
$win
)
{
...
@@ -162,10 +163,33 @@ sub hog { # summon the hand of god
...
@@ -162,10 +163,33 @@ sub hog { # summon the hand of god
Irpg::Irc::
chanmsg
("
$player
reaches next level in
"
.
duration
(
$rps
->
{
$player
}{
next
})
.
"
.
");
Irpg::Irc::
chanmsg
("
$player
reaches next level in
"
.
duration
(
$rps
->
{
$player
}{
next
})
.
"
.
");
}
}
sub
c
alamity
{
# suffer a little one
sub
c
hoose_player
{
my
@players
=
grep
{
$rps
->
{
$_
}{
online
}
}
keys
(
%$rps
);
my
@players
=
grep
{
$rps
->
{
$_
}{
online
}
}
keys
(
%$rps
);
return
unless
@players
;
return
unless
@players
;
my
$player
=
$players
[
rand
(
@players
)];
#sort players by group of same levels
my
%levels
=
();
foreach
(
@players
)
{
if
(
exists
$levels
{
$rps
->
{
$_
}{
level
}})
{
push
$levels
{
$rps
->
{
$_
}{
level
}},
$_
;
}
else
{
$levels
{
$rps
->
{
$_
}{
level
}}
=
[
$_
,];
}
}
@players
=
@levels
{
sort
keys
%levels
};
#exponential distribution on levels (lambda = 0.5)
@players
=
@
{
$players
[
-
log
(
rand
)
/
0.5
]};
#then uniform distribution for players of the same level
return
$players
[
rand
(
@players
)];
}
sub
calamity
{
# suffer a little one
#my @players = grep { $rps->{$_}{online} } keys(%$rps);
#return unless @players;
#my $player = $players[rand(@players)];
my
$player
=
choose_player
()
||
return
;
if
(
rand
(
10
)
<
1
)
{
if
(
rand
(
10
)
<
1
)
{
my
@items
=
("
amulet
","
charm
","
weapon
","
tunic
","
set of leggings
",
my
@items
=
("
amulet
","
charm
","
weapon
","
tunic
","
set of leggings
",
"
shield
");
"
shield
");
...
@@ -234,9 +258,10 @@ sub calamity { # suffer a little one
...
@@ -234,9 +258,10 @@ sub calamity { # suffer a little one
}
}
sub
godsend
{
# bless the unworthy
sub
godsend
{
# bless the unworthy
my
@players
=
grep
{
$rps
->
{
$_
}{
online
}
}
keys
(
%$rps
);
#my @players = grep { $rps->{$_}{online} } keys(%$rps);
return
unless
@players
;
#return unless @players;
my
$player
=
$players
[
rand
(
@players
)];
#my $player = $players[rand(@players)];
my
$player
=
choose_player
()
||
return
;
if
(
rand
(
10
)
<
1
)
{
if
(
rand
(
10
)
<
1
)
{
my
@items
=
("
amulet
","
charm
","
weapon
","
tunic
","
set of leggings
",
my
@items
=
("
amulet
","
charm
","
weapon
","
tunic
","
set of leggings
",
"
shield
");
"
shield
");
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter