catfooll

Historial

May 22nd, 2024
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1.  
  2. /// FUNCION JUGADOR
  3. /// SU FUNCIONES ES CLASiFICAR POR UN OBJETO LLAMADO JUGADOR CON 4 PROPIEDADES LAS CUALES ES SU INFORMACION.
  4.  
  5. var JUGADOR = /** @class */ (function () {
  6. function JUGADOR(n, r, e, a) {
  7. this.nombre = n;
  8. this.rol = r;
  9. this.edad = e;
  10. this.sexo= a;
  11. }
  12. JUGADOR.prototype.mostrarInfo = function () {
  13. document.write(" <br> - El jugador " + this.nombre + " de rol: " + this.rol + " y tiene edad " + this.edad + "<br>");
  14. };
  15. JUGADOR.prototype.ATACAR = function (AT, J) {
  16. document.write(" <br> - El jugador " + this.nombre + " atacara " + AT + " veces a jugador: " + J + "<br>");
  17. };
  18. JUGADOR.prototype.dormir = function (nm) {
  19. document.write("<br> - JUGADOR " + this.nombre + " duerme " + nm + " minutos " + "<br>");
  20. };
  21.  
  22. JUGADOR.prototype.ESCONDETE = function (EC, min) {
  23. document.write(" <br> - JUGADOR " + this.nombre + " se escondio en : " + EC + " x "+ min +" minutos " + "<br>");
  24. };
  25.  
  26. return JUGADOR;
  27.  
  28. }());
  29.  
  30. /// CLASE TITULOS
  31.  
  32. class TITLES{
  33. constructor(C) {
  34.  
  35. this.color_piel = C;
  36.  
  37. }
  38. mostrar() {
  39. document.write("<br><br>" + this.color_piel + "<br><br>");
  40. }
  41. }
  42.  
  43. var p1, p2, p3, T1, T2, T3;
  44. T1 = new TITLES("[ INFORMACION JUGADORES ]");
  45. T2 = new TITLES("[ HISTORIAL DE JUGADAS ]");
  46. T3 = new TITLES("[ SKIN DE JUGADORES ]")
  47. p1 = new JUGADOR("SANCHEZ","CIVIL", 12, "H");
  48. p2 = new JUGADOR("CHILY", "TRAFICANTE", 11, "M");
  49. p3 = new JUGADOR("MANUEL", "CIVIL", 10, "MTF" );
  50. p4 = new JUGADOR("JAVI", "REY", 15, "M" );
  51.  
  52. T1.mostrar();
  53. p1.mostrarInfo();
  54. p2.mostrarInfo();
  55. p3.mostrarInfo();
  56. p4.mostrarInfo();
  57.  
  58. T2.mostrar();
  59.  
  60. p1.ATACAR(9,"CHILY");
  61. p2.dormir(90);
  62. p1.dormir(200);
  63. p3.ATACAR(3,"SANCHEZ");
  64. p1.ESCONDETE("un arbol",5);
  65. p4.dormir(1000)
  66. p4.ESCONDETE("en su camuflaje",9);
  67. p5.ATACAR(9,"CHILY");
Advertisement
Add Comment
Please, Sign In to add comment